x


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?

more ▼

asked Jun 01 '11 at 08:12 PM

smasgames gravatar image

smasgames
34 25 29 32

(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x5059
x801
x764
x652
x416

asked: Jun 01 '11 at 08:12 PM

Seen: 1136 times

Last Updated: Jun 01 '11 at 09:13 PM