I build a small town and I need to create a cars are driving on the town, I created a car is doving and when I get close to her the car stop moving and when I go away from her she keep moving.
My problem is this is working on animations and when I go away from the car the animation start from the begining of the animation and not from where it’s stoped.
this is the script I’m using:
Code:
function OnTriggerEnter (hit : Collider)
{
if (hit.gameObject.tag == “Player”)
animation.Stop(“DRIVE”);
}
function OnTriggerExit (other : Collider)
{
animation.Play(“DRIVE”);
}
And I know where the problem is, here:
Code:
function OnTriggerExit (other : Collider)
{
animation.Play(“DRIVE”);
}
So, there is someway to cause to the animation continue from where it stopped?