Hello, i’m creating a laser turret and I created a Mesh Renderer Niagara. Is there anyway to modify its rotation and length to touch the line trace goal? I want to avoid using a ribbon niagara…
Hi @gingertomy
Let’s see…
Do a Line Trace: Get the start and end locations from the trace
Calculate the Direction & Length:
Use vector math to get the direction and distance (length) between the start and end locations.
Direction = Normalize(EndPosition - StartPosition)
LaserLength = Distance(StartPosition, EndPosition)
Calculate the Rotation: Use a LookAtRotation (or similar) to get the rotation from start to end location
Utilize in Niagara System:
Utilize LaserLength to use as mesh scale
Set mesh rotation according to the computed LaserRotation.
Update the Mesh Renderer: Ensure that the Mesh Renderer of the Niagara System uses variables for length and rotation to respond dynamically.
This function will have the laser mesh align with the line trace target without using a ribbon