x


Help with my On_Bullet please

var tempo : float;

var legno : PhysicMaterial;
var metallo : PhysicMaterial;
var pelle : PhysicMaterial;
var ghiaccio : PhysicMaterial;

var Hit_metal : Texture;
var Hit_wood : Texture;
var Hit_ice : Texture;
var Hit_skin : Texture;

var Hit_skin_part : GameObject;
var Hit_metal_part : GameObject;
var Hit_wood_part : GameObject;
var Hit_ice_part : GameObject;

function Update () {
         Destroy(gameObject,tempo);
}
function OnCollisionEnter(collision : Collision) {
 if (collision.collider.material == legno){
   Instantiate(Hit_wood_part, collision.contacts[0].point.zero,Quaternion.identity);//collision.contacts[0].point.rotation);
}

Destroy(gameObject);
}

But It don't Instantiate the Particle

more ▼

asked May 01 '11 at 12:07 PM

aser gravatar image

aser
1 1 1

Put Print("test"); just before your instantiate inside the if statement to see if you're getting to that part of the code

May 01 '11 at 01:11 PM GesterX
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Not really sure what you want this script to do, but it looks like your update function is always going to be destroying your gameObject everyframe.

Update your post with want your script is suppose to do, and what its doing now.

more ▼

answered May 01 '11 at 02:23 PM

oliver-jones gravatar image

oliver-jones
2.5k 207 226 257

(comments are locked)
10|3000 characters needed characters left
Your answer
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:

x3570
x2584
x1725
x194

asked: May 01 '11 at 12:07 PM

Seen: 397 times

Last Updated: May 01 '11 at 12:07 PM