How to limit local axis using FindLookAtRotation?

Hi,

I am projecting a plane that follows the player onto a sphere & need to limit the z axis rotation when using the equivalent of the FindLookAtRotation function.

I replicated the FindLookAtRotation function with MakeRotFromZ instead of MakeRotFromX, and it will point at the correct target on the surface of the sphere, but I want to remove the local Z axis rotation that it produces.

Please let me know if you have an idea.

Cheers,
Kevin

Thank you OttomanEmpire,

I gave it a shot, but everytime I try to lock an axis, it won’t track to the player anymore. I may be forming the MakeRotFromZ wrong.

I didn’t try this because I wasn’t at home.
I am glad you solved the problem by yourself. Have a good day.

I solved the issue by using MakeRotFromZY (works with MakeRotFromZX as well). The problem was that MakeRot will choose any two orthogonal vectors to Z, so you have to specify an additional vector to keep the local transform changes consistent.

1-)Right click on NewRotation pin of SetActorRotation. And split pin to float values. => x:(a) y:(b) z:(c)

2-)GetActorRotation and split output pin to float values. => x:(d) y:(e) z:(f)

3-)Split output pin of MakeRotFromZ. => x:(g) y:(h) z:(j)

For example:
If you want to lock Z you should do this;

g => a

h => b

f => c