Tilt object around calculated line

Hi, we’re working on a project that simulates an object that tilts around a line calculated in the code. It uses 2 objects and their positions the get the direction and position of the tilting line.The 2 positions of the objects to generate the tilting line is no problem.
Our question is: How do we use that line to tilt an object around it? Sort of like a tipping scale but with hardcoded values as to how deep it needs to tilt.

Something like this maybe?

There are a number of ways to approach this, If your looking for something mathy you could always utilize the rodrigues rotation formula given you you have a directional vector (the line points make this) and just can use the objects current position to generate a vector to rotate.

however given that you’re doing this in unreal, why not take advantage of local rotation on an object level and parent your desired tilting object to it?

If your simply dealing with a standard straight line, then you could simple set an objects position along the line and rotate that object locally to rotate any child object relative to it.

the more complex form would allow for any line shape, but would still use a spline as a base.

I will attach a visual example of both here, let me know which you might need more explanation on.

Simple Line Example

315740-simple.gif

Complex Line Example

315741-complex-1.gif