- Home /
Bullet particle wrong draw position while moving
I'm trying to create shooter-style bullet using particle and raycast by instantiating particle at gun end point. Everything is fine untill I start rotating or moving: It seems that bullet instantiated at previous frame at poitn where I been a frame ago (see video). What is the best practices to draw bullets?
void Update()...
Instantiate(traceParticle, gunEnd.position, Quaternion.LookRotation(bulletDestination))
My particle settings:
Answer by ifurkend · Sep 28, 2017 at 10:47 PM
You should not instantiate the particle prefab per fire because it undermines performance. Either way, you should parent the effect to your gunEnd object . First change your particle simulation space to World. Second enable "looping" of the system. Each time you stop fire, use ParticleSystem.Stop() to literally stop emitting bullet particles, this function does not kill still-alive particles by default. When you fire again, just use ParticleSystem.Play() to resume.
thanks for your advice, now it doesn't look dettached, but because of bullet scattering doesn't look good: already firedd bullets changing their rotation because it is a single particlesystem, how should I fix it? video
I'm not entirely sure the problem from your video. It seems you intentionally deflect the bullet path slightly for realism. Shape and velocity over lifetime modules are responsible for the deflection, to name a few before understanding the full setting of your bullet particle system.
Your answer
![](https://koobas.hobune.stream/wayback/20220612135848im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to add impact sparks / blood effects to 2D shooter? 2 Answers
Mobile magic bullet 0 Answers
how to have bullets produce particles? 2 Answers
Best way to make bullets? 2 Answers