Hello all, I’ve got a vector math problem that I think might be easy to solve, I’m just missing an important piece. I have a laser gun that I’m using a niagara particle system to do the fx for. The laser it shoots is a continuous beam from the barrel of the gun (variable Shot Location) to where the player is aiming (variable Impact Point) that is fired until the trigger is let go. I have some fx that play as a result of the laser hitting an object at the end of the laser beam. To prevent the impact fx from ‘dragging’ when I move the beam across a surface and keep it locked to the end of the beam, I’m trying to keep the impact fx in local space of the niagara system.
This is where my problem is, I need to convert the position vectors of the shot location and impact point to local space. The laser starts at 0,0,0 in the niagara simulation, so that was an easy solve, but the end of the beam has been proving difficult. I need the position vector of the end of the beam to keep its offset from the start position. You would think subtracting the position of the start of the beam from the end would translate it to the coordinate space I need, right? But it’s providing wonky results.
The niagara system is spawned attached to the barrel of the gun, btw.
I assume the problem is my math. Greatly appreciative if anyone knows whats up.