I've been searching around and cant find something that actually works. I'm creating a top-down shooter and all i want to do is to shoot particles...i already have a shoot script that instantiates and object when the fire button is pressed...i tried created a particle system, puting it inside a prefab and using the script to instantiate but when the fire button is pressed, the particles don't shoot like bullets, seems like they float there...here is the code i have so far:
I am also aiming towards having 3 bullets being shot at once...hence the "for" loop...
var speed : int;
var cratePrefab:Transform;
var bullNum : int;
function Update()
{
if(Input.GetButtonDown("Fire1"))
{
if(Collisions.GRENADE_AMMO > 0)
{
Collisions.GRENADE_AMMO -= 1;
for (var i=0; i<3 ; i++)
{
//GameObject.Find("g_count").guiText.text=""+Collisions.GRENADE_AMMO;
var crate = Instantiate(cratePrefab,GameObject.Find("shootpoint").transform.position,Quaternion.identity);
crate.rigidbody.velocity = transform.forward * speed;
}
}
}
}