Quantcast
Channel: Questions in topic: "follow"
Viewing all articles
Browse latest Browse all 536

How can I get my camera to follow a clone after a certain trigger occurs?

$
0
0
The next issue I've been biting my teeth out on: After trigger occurs, I want my main Player camera to focus its "gaze" on the incoming enemy **clone** which has spawned. Problem is though, it wont. Is there something I'm missing in my code? How can I address the spawned "enemy(Clone)" properly? All done in **Javascript** btw. Any help greatly appreciated! var camLookAt : Transform; var cameraUsed : Camera; var Haunt : GameObject; function SetCam() { if(PlayerSpawnTrigger.spawning == true) { camLookAt = GameObject.FindWithTag("Haunt").transform; } } function Update() { if (GazeChecker.ForceGaze == true) { cameraUsed.transform.LookAt (camLookAt); } }

Viewing all articles
Browse latest Browse all 536

Trending Articles