I am trying to make my grenade explode but when i throw it nothing happens. can someone please help me. my script is the one i have attached to grenade prefab
var creationTime = Time.time;
var explosionPrefab : Transform;
function Awake()
{
creationTime = Time.time;
}
function Update ()
{
if(Time.time < (creationTime-3))
{
Destroy(gameObject);
Instantiate(explosionPrefab, transform.position, Quaternion.identity);
}
}