I want to change the position of the camera to a certain position when the player collides with this GameObject. I’ve made the GameObject into a rigidbody (non-kinematic). Still, it doesn’t seem to work. I’m not very good at UnityScript because I’m just starting out, but this is what I have so far (again… I’m not very good):
var sceneCam : GameObject;
sceneCam = GameObject.Find("MainCam");
function OnCollisionEnter(theCollision : Collision){
if(theCollision.gameObject.name == "Player"){
sceneCam.transform.position = Vector3(-20.46, 4.258904, -805.3136);
}
}
EDIT: Is there any way to make the position change smoothly? I’ve heard of Time.deltaTime… but I’m not familiar with how to use it.
Thanks guys, any help is appreciated.