- Home /
My Enemy isn't moving!
I am a student working on a simple game where the enemy gets closer to you when you're not looking at it. The code so far is making the enemy turn and and face the player when the player looks away and back at the enemy, but he's not moving. This is the entire script. Any help would be appreciated!
enter code here
var LookAtTarget:Transform;
function Update() { }
function OnBecameVisible () { print("HECANSEEME"); transform.Translate (0,0,0*Time.deltaTime); }
function OnBecameInvisible () { print("IMCOMING!"); transform.LookAt (LookAtTarget); transform.Translate (0,0,20*Time.deltaTime); }
Your answer
Follow this Question
Related Questions
why the function OnBecameVisible and OnBecameInvisible doesn't work in canvas renderer ? 1 Answer
Help fixing AI? 1 Answer
How do I stop a moving object when the Camera sees it 1 Answer
highlight objects which are visible in camera? 0 Answers
How do I trigger the visibility of an object through OnBecame(In)visible? 0 Answers