- Home /
 
change script so enemy car gets destroyed when collided with player car
public var explosionPrefab : Transform;
function OnCollisionEnter(collidedObject : Collision) { 
 if (collidedObject.gameObject.tag == "Finish") { 
 Destroy(collidedObject.gameObject); 
 }
 }
my enemy car will be the target and if it gets hit 3-4 times by my player car, it'll die. how do i change the script so when it collisions with or is collided with PlayerCar its gets destroyed?
               Comment
              
 
               
              Your answer
 
             Follow this Question
Related Questions
Destroy Scripting Help 1 Answer
Deduct health on collision 2 Answers
help loading level after destroying objects 1 Answer
Need help with enemy spawner 2 Answers
Distance destroy object 3 Answers