Help shooting particles as bullets.

I’ve tried just about all I can think of with my limited knowledge of the Unity API. I created a C# script similar to the one in the FPS tutorial, created a prefab with a particle system attached to it, and then tried Instantiating that prefab, then changing the prefabs transform.localPosition so move it, but it seems to move forward once then stop. I tried a lot of combinations of parenting in the prefab, and adding rigidbodies (making a child mesh, adding a rigidbody to it, then childing a particle system to that. I tried things along those , ect… writing the script differently, all not working. It would either say it was null, or not move, or spawn at some random point.

So, I’m starting from scratch hoping someone can help me figure a felxible shooting system using prefabs of different particle systems (so I can easily change the prefab it instantiates, allowing for different “weapons”).

Thanks,
Jedd

the rocket setup from the FPS tut should give you info on everything you listed above (though if i remember correctly the scripts are javascript).

  1. did you drag your projectile prefab to the script in the inspector?

  2. is there a move script attached to the projectile or are you applying a force or something from the gun script (since you mention rigidbody)?

  3. make sure your projectile center is correct you have an empty GO exactly placed where you want the projectile to spawn. EDIT: with proper forward orientation too - that still can get me sometimes ; )

What I need help is how to make the actual bullet particles (like in MegaPixel). Do I need a rigidbody? How should everything be parented?

Edit - Nevermind, I figured it out :slight_smile:

Thanks for your help!