OnTrigger Camera

Hi,

I haven’t written any code for this yet, but what I want is to have one camera, ‘MainCamera’ be the main perspective throughout the game. However, if you collide with a certain GameObject, I want the camera, or cameras, to change perspective. Let’s say, for example, the hero moves along the game and then falls into a pit. I would like to watch the hero, from the OnTrigger point, continue to fall away from that camera.

I’m just looking for advice and maybe some generic code to help with constructing this concept.

Thank you

I would angle the object with the trigger the way you would want the camera to face, then when when it’s t
riggered, move the camera to that point and have it use the rotation.

var triggerPoint : Transform;
//you would just get the collider's transform from the OnTriggerEnter, collider.gameObject.transform.

function Start()
{
	CameraMove();
}

function CameraMove()
{
	yield WaitForSeconds(2);
	transform.position = triggerPoint.position;
	transform.rotation = triggerPoint.rotation;
}

Hope this helps, post if you have any questions.