What is the logic and approach I should use to get the forward vector of my particle mesh to follow a spline and to make the top vector of my mesh to face away from a point while following a spline path?
Example: I currently have a planet project and am trying to get the mesh orientation of my Niagara mesh particle to follow the path of the spline but have its forward vector completely following the spline path, while also having the top vector face away from the planet.
Main two things I am trying to understand using the Niagara System for my mesh particle
1.Forward vector
2.Up vector
This is currently what I was able to think up, It works perfect for the z-axis view but from any other axis view you can see where it falls short.
You can sample both Forward Vector (Direction) and Up Vector in your Niagara Module and store the values as Particle Attributes so that you can access them in other Niagara Modules
The problem then is to make sure your spline-up vector is correct, in my example I’ve just drawn a spline around a sphere. As expected I get this result:
Some meshes on one part of the spline are aligned nicely but other parts aren’t.
If you want the particles’ up vector always facing away from the planet you can calculate it in Niagara if you move the Niagara System in your level to the center of the planet and then subtract that position from the particle’s position.
Add the particle’s position and the position of the emitter (Engine Emitter SimulationPosition) in your “Map Get” node, covert them to vectors, subtract one to the other and plug the result in a “Direction and Lenght Safe” node (to normalize the vector) and that’s going to be your new UpVector.
Do a cross product to get the right vector if you need that one as well