How to create particle system on a collision?

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);
}
}

You weren’t using Instantiate the right way.

var explosionPrefab : Transform;
    
function OnCollisionEnter (collision : Collision) { 
    if (collision.gameObject.tag == "Hammer") { 
        Debug.Log("Die ball!"); 
        var boom : GameObject = Instantiate(explosionPrefab, transform.position, Quaternion.identity);
        Destroy(gameObject, 0.1); // also sometimes destroying right away causes problems
    }
}