Help with orienting Niagara Mesh Renderer towards a point / location?

Hello, I am working on a crowd simulation and have everything except the correct orientation. The goal is to have all of the characters facing towards the center of the arena (simulation location), and currently they are all facing the same direction:

image

I know this is straightforward with the Sprite Renderer since you can set a custom direction vector as seen in the Content Examples project. I have yet to see anything similar for the Mesh Renderer, though.

So far I’ve tried using the Scratch Pad to set the Mesh Orientation (quaternion), but do not have the correct math, and there is no ‘LookAt’ type of function similar to what Unity has available. I’ve also looked into applying a small force, and orienting in the direction, but I do not wish to move the meshes, only set the orientation.

If anyone can assist with this it is much appreciated!

1 Like

Okay, finally got this one. So you get the direction vector from the particle position to the target location (in this case {0,0,0}), and use the cross product of that and the world up axis with Make Quaternion from X and Z Vectors.

2 Likes