Hi!
I got this script attached to objects on a race track in my game:
var Object : Transform;
function OnCollisionEnter () {
if(Car.velocity >= 30){
Destroy (gameObject);var theClonedObject : Transform;
theClonedExplosion = Instantiate(Object,
transform.position, transform.rotation);
}
}
I need to know the velocity of the player controlled car. Without the if statement the function triggers immediattely on playing the scene, since the objects are colliding with the terrain. Anybody knows ho to fix this? Or is there some other solution?
Thanks in advance!