Constraining paper character rotation to a 2d plane

I have a top-down 2d shooter game where I want to have the characters rotating to the direction they are travelling. This can be achieved by ticking a box in the character movement component, and also through get lookat direction in the graph editor.

However, to maintain the 2D effect, the actors must rotate only around the Y-axis, and as it stands they rotate through whichever combination of axes gets there most directly, resulting in the paper flip-book characters flipping over in 3D.

It feels like there must be a simple solution to this problem that must be met by almost every 2d game. Can anyone give me tip please?

I have fixed my ownb problem and am posting for others wioth the same issue.

Find Look At Rotation is always a 3D vector, and cannot be constrained. In a 2D game, the rotation will go crazy due to gimbal lock if the actor and its target share the same value on an axis (in my game everything is at Y=0).

If one actor is displaced (eg, Y=0.1) the issue is fixed, and is visually the same.

231136-2d-lookatrotation-fix.png

1 Like