stop moving forward when collide with player then continue
i am trying to make it where when an object with the script attached hits the player, it stops for one second, then continues to move forward again, here is the script.
pragma strict
var speed : float=0.02; function Start () {
}
function Update () {
transform.Translate(Vector3.forward speed Time.deltaTime);
}
Comment
this just moves. have you even tried reacting to collision events?
Answer by josak46 · Feb 16, 2016 at 09:23 PM
You should look at this: http://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html and http://docs.unity3d.com/ScriptReference/WaitForSeconds.html