Aligning rotations on only one plane

Hi,

I’m lerping an actor from one “current” rotation to another “target” rotation.

The basic setup is working fine, but I’ve been struggling for days with how to ‘ignore’ one local rotation plane in the target rotation.

Like sticking a magnet to a fridge door:

  • the magnet has a random “current” rotation,
  • the fridge door has a “target” rotation
  • we don’t care which part of the magnet is pointing up or down, just that the ‘planes’ of the magnet and the fridge are alligned
  • the magnet should rotate along the shortest rotation

The question is: if my inputs are the source and the target rotation, how to calculate an ‘adjusted target rotation’ that I can lerp to?

Hope I wrote the question down in a way that is understandable…

Alright then! Took me many hours going in the wrong direction but finally found the answer: take the “Up
Vector” from the target rotation, take the “Forward Vector” from the source rotation and combine them with “Make Rot from ZX” (with this specific node, the Z vector (=Up) will remain unchanged, while the X vector (=forward) is adjusted to make orthogonal angles, see screenshot for details.

Hope it helps someone!