system
1
var bullitPrefab:Transform;
function Update ()
{
if(Input.GetKeyDown("e"))
{
var bullit = Instantiate(bullitPrefab, GameObject.Find("SummonEscape_Spawn").transform.position, Quaternion.identity);
bullit.rigidbody.AddForce(transform.forward * 100);
}
}
system
2
function Update()
{
if(Input.GetKeyDown("e"))
{
spawnBullet(grenade);
}
}
var grenade;
spawnBullet()
{
Instantiate(grenade, GameObject.Find("SummonEscape_Spawn").transform.position, Quaternion.identity);
grenade.rigidbody.AddForce(transform.forward*100);
yield WaitForSeconds(3);
Destroy(grenade);
}
Not tested, but should work.