- Home /
transform.LookAt is not looking, and not displaying errors?
Hi all. I am using this code to make on of my AI look at a random waypoint.
var waypoint : Transform[];
function update() {
transform.LookAt(waypoint[Random.Range(0, waypoint.Length)]);
}
However, it is not working. When I apply it to a cube, the cube just sits there without turning, and it doesn't give me any errors. I am not sure what could be causing this. Any help would be greatly appreciated. Thanks in advance!
Comment
Best Answer
Answer by whydoidoit · Jun 20, 2013 at 01:28 AM
The function you should write is Update not update.
Thanks! It worked... now I feel like an idiot. Gotta love syntax :P
Your answer
Follow this Question
Related Questions
look at closer 1 Answer
LookAt something while rotating on z? 1 Answer
LookAt only when camera position changes 2 Answers