Hi there,
I have my camera moving script, basically What I am trying to do, is on collision of the character on another object I need the following camera script to run, basically the camera to starts moving up.
var Speed = 1;
function Update ()
{
transform.Translate(Vector3(0,1,0) * Time.deltaTime);
}
Here is a script that I have been working on for OnCollisionEnter and I can’t get it to run. anyone have any suggestions? or recommend another way to approach this?
var Speed = 1;
var touched = new HashSet.<GameObject>();
function OnCollisionEnter(collision : Collision) {
if (collision.gameObject.tag == ("Player") touched.Add(collision.gameObject))
{
transform.Translate(Vector3(0,1,0) * Time.deltaTime);
}
}
Thanks