I was wondering if there was any point of using the particle system for this feature over the current rigidbody I have currently and what are the benefits of switching over.
If anyone has ever played shooter games they would know the bullet shell particle when a gun is fired:
The bullet shell will bounce and roll once it hits the ground(Physics) for it’s lifetime.
It will have a mesh to be rendered in the form of a capsule with a low texture material
Optional: When it hits the ground a sound of a bullet drop will play.
The explosion force is random but will spawn from where the gun transform is
It has no function in the gameworld besides visuals
At the moment I’m using a regular gameobject to accomplish this but I was wondering if it’s worth switching over to the particle system to accomplish this. Is it more performant even though there are collisions and physics? The game I’m making is actually isometric so maybe I can get away with billboarding a bullet sprite instead? Any help is appreciated!
In this cases you should ask yourself if it is a visual thing or something will affect the gameplay:
-For example, a grenade will affect the gameplay, so use a particle system is not a good idea
-Other example is yours; the player will not focus in the empty bullets and just see them in background. That plus the fact that you will spawn a lot of them sounds like you will have to make a particle system with play on awake putted off and when you shoot call play()
Awesome thank you! Also i forgot to ask but the empty bullets only come up when the player presses shoot. How would I be able to program it so that the old bullets dont get removed when the player shoots another time assuming we are using one game object w/ a particle system?
I guess you will have a particle system that emmits bullet particles.
First of all, destroying the old particle isn’t really a problem since players are not going to search all the particles.
You said that your particles collide and bounce, but since there are deccorative it is kinda useless.
Anyway, you can activate/deactivate the particle system emmision module when you shoot, and have the timing so in the frame the emmision module is activated just one bullet is created.
Moreover, you may emit the particles individually yourself with ParticleSystem.Emit(). This way you can emit exactly one bullet shell for each bullet fired, in perfect sync.
Destroying the particles it’s not a problem because you configure their lifespan in the particle system settings.