I’m trying to make a bullet trace effect in Niagara.
I have a problem with the “Add Velocity” module. I made it linear and set the Velocity parameter to the result location vector of a line trace that goes out of the player character’s gun.
The code that spawns the particle system:
The “Add Velocity” module:
What I get:
For some reason, the velocity vector doesn’t match the line trace hit result.
I tried setting the same vector to Beam End in a default dynamic beam for the purpose of testing. I ticked the “Absolute Beam Start” and “Absolute Beam End” boxes:
For some reason, in the Niagara system viewport my tracer and the dynamic beam are pointed in the same direction, but in the game, the dynamic beam matches the line trace, while the tracer particle doesn’t:
I think it might be related to the tracer velocity vector not being “absolute” like Beam End, but the Rotation Mode on my velocity is set to “World” which should make it absolute, right?
How do I solve this problem?