So the idea is to let the character stick to any surface. Upside down or sideways, you name it.
And it works… in theory.
So if I place the character near a surface, it sticks to it no problem:
However, if it is possessed, the rotation freaks the hell out when crossing 90°:
(you can still see the uncontrolled character idling up there)
The method is pretty simple, a line trace gets the normal of the surface, adjusts the rotation accordingly and then adds force to the character movement component towards the surface.
I have seen similar topics already, where people ask how to do it, usually answered by other people saying it’s hard to do and not explaining why it would be so hard.
So, my question is, why does it work when the pawn is not controlled but doesn’t work if it’s possessed?
(to clarify, the character also freaks out if it’s being possessed while already sitting at an angle >= 90°)
Any ideas are appreciated.
(also here is the blueprint script responsible for keeping the character on the surface: https://blueprintue.com/blueprint/h7iy-95r/, I don’t really see why it is freaking out like that)
EDIT: Nevermind, I think I’ve got the answer. The freaking out has probably to do with gimbal lock.
So when yaw and pitch align it messes up the whole rotation. Will provide the full explanation when I found a clean way to fix it.