Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Help with a simple following AI

$
0
0
So I have been working on a basic javascript code that makes an object, in my case a zombie, look at and follow another object, the Player. For some reason this code is pulling the error: "'transform' is not a member of 'Object'. " Any ideas? Here is my code: #pragma strict var speed = .7; var target; function Start () { target = GameObject.Find("Player"); } function Update () { transform.LookAt(target.transform); transform.position += transform.forward * speed * Time.deltaTime; }

Viewing all articles
Browse latest Browse all 171066

Trending Articles