Particles moving past gun. Please help.
I am trying to create muzzle flash but whatever I do the particles system still doesn't stick properly to the gun, eg. i run and the particles go behind the gun, i turn and it takes time for them to meet up with the barrel. I tried unchecking simulate in worldspace for the emitter, I tried parenting the object. I'm clueless. Instantiate(muzzleFlash, barrelEnd.transform.position, barrelEnd.transform.rotation); barrelEnd.transform.parent = gameObject.transform;
Answer by Domo23000 · Nov 21, 2015 at 06:49 PM
You aren't parenting the particles you are parenting the transform where the particles are created. Try this
GameObject particles = Instantiate(muzzleFlash, barrelEnd.transform.position, barrelEnd.transform.rotation) as GameObject;
particles.transform.parent = gameobject.transform;
I would also parent the particles to the barrelEnd instead of the gun itself
Ah, I had the variable for my muzzleFlash as ParticleEmitter, I was completely ignorant and forgot. :/
Thank you kindly for your help though, I should've know that I was parenting it wrong. I really do appreciate it.
Your answer
Follow this Question
Related Questions
order of scripts 2 Answers
how i can set attack back to false ? 0 Answers
How can I generate mesh triangles with the particles for a plexus effect ? 0 Answers