- Home /
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
Put Print("test"); just before your instantiate inside the if statement to see if you're getting to that part of the code
Answer by oliver-jones · May 01, 2011 at 02:23 PM
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.
Your answer
Follow this Question
Related Questions
Getting info about hit Object (Javascript). 1 Answer
How to instantiate on collision? 0 Answers
Prevent instantiating on collider 1 Answer