I have a character which can walk along a wall as well as the ground with no problems. While I don’t have any problems with the character’s rotation itself, I am having trouble with the numerical values of its rotation when it is on the wall.
When I rotate my character everything looks fine in the game, it can make a full circle. However when I look in the inspector at the transform’s rotation, it “ping-pongs” between 270 and 90. if I rotate in one direction continuously, the inspector value will go up to 90, but then as I keep rotating, starts going backwards back down to 0 and then down further towards 270.
Why is this happening and how can I fix it? I need to have the correct rotation value because it is used by something else in my game.
It doesn’t happen when the character is on the ground, only when they are on the wall.
when on the ground it rotates through the y axis, and when on the wall it rotates through the x axis. The same thing happens whether I am rotating the character in gameplay, or using the gizmo in the scene view.
Any help much appreciated!