how do I "point" a particle burst towards gun direction

Hi everyone

I’m trying to get a muzzle flash to point in the direction that my rifle is facing (ie, it spawns at the end of the barrel, i need it to look as you would expect). I have the particle system spawning when the fire action is triggered, and it’s spawning in the right location, but its facing left; I need it to point in the same direction that the gun is facing.

I have an aim mechanic that lets the player be stationary but aim up/down/left/right etc - so the player capsule could be facing forward, but the character could be in an animation state where he is pointing the gun anywhere

by default, my weapon skeletal mesh is at 000 with no rotation (when I export the fbx from max) - it has 1 root bone. When the character is holding the weapon, i have no idea what the guns new rotation is, or how to tell in what direction is it pointing

any idea’s on the best way to go about this? Thanks : )

I agree that you should try sockets, but here’s an additional thought: if you’re using a FirstPersonTemplate, you may want to use the FirstPersonCamera’s forward vector, as the weapon follows the camera rotation.

Hello digs,

The best way to do this would be to add a socket to the end of the gun’s barrel and then attach the particle system to the socket. This way, the particle system will move along with the end of the barrel and share its rotation. Have you given this a try as of yet? If you can find more information about sockets with static meshes (what I’m assuming your gun is) here:

thanks guys

I am using a socket at the end of the barrel; this is where the particle system spawns. My problem is that the particle system (in cascade) “appears” to fire in one direction, ie, left. What I can’t figure out is how to make the particle system “appear” to be firing in the same direction the gun is facing.

This is a 3rd person shooter - I can’t use the direction the player capsule is facing, because of the aim mechanic

ie, if you fired a ray from the start of the barrel to the end of the barrel, the particle system should orient itseld along that vector (i think) - so, the direction the 3rd person character is aiming, not facing

That is very odd, but you could use another interpretation of tendo23’s idea and get the forward vector of the gun’s static mesh instead. Can you give that a try and see where that gets you?

ill try it out!

I was able to use the socket rotation as particle rotation, thanks for the help!