Hi I need to know how to emit a particle system on collision. For example I have a sphere and my character has a player, I have it so when the player hits the sphere it gets destroyed and a particle system emits. But it won’t work the code i’m using is below. Thanks for your help(:
var explosionPrefab : Transform;
function OnCollisionEnter(collision : Collision)
{
if (collision.gameObject.tag == “Hammer”)
{
Debug.Log(“Die ball!”);
Instantiate(explosionPrefab);
Destroy(gameObject);
}
}