Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Can somebody please help me with my code - what do i need to add to make my camera turn SMOOTHLY towards the enemy?

$
0
0
So i have this code and everything is working just fine - as soon as the enemy is within a given vicinity my players camera is turned towards it. As of now the camera just "jumps" directly into the new "lookAt position"...what do i need to add to make my player's camera turn smoothly? Heres my code (done in javascript): var camLookAt : Transform; var cameraUsed : Camera; var Haunt : GameObject; function SetCam() { if(PlayerSpawnTrigger.spawning == true) { if(GameObject.Find("Haunt") != null) camLookAt.position = GameObject.Find("Haunt").transform.position; } } function Update() { SetCam(); if (GazeChecker.ForceGaze == true) { cameraUsed.transform.LookAt (camLookAt); } } Thx a lot guys ;)

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>