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 ;)
↧