Download

Problem with pitch rotation

Hello,

I trying to make little project. It will be something like top-down shooter. And I experimenting with gravity of my character. I using a bit of Directional & Planet Gravity Plugin to get directional gravity. And that works pretty well. Then I tried to implement feature that character will be rotating with mouse cursor. When my character is on ground rotation works well (YAW rotation). But when I put my character on wall (after changing gravity) something starts to go wrong. I rotating character in Pitch and trying face to cursor. From 0 (degress) to 90 work ok, BUT then its back again to 0. And to -90, then again back to 0. And sometimes character rotate correct and after moment starts to rotate in wrong direction.

Video (problem from 0:30)
https://youtu.be/P0bqhwJ2z_4

My function to rotate character (on wall, on ground diffrence is that I rotate Yaw not pitch), I just put it in Tick.

I trying few other ways to rotate character with mouse, but everyting gives same result. Decoy on ground showing position of cursor, and that one shows that cursor works well.
I though that maybe it is connected with changing gravity but I tried to disable facing function and rotating my character manually (using AddActorWorldRotation) and still goes from 0 to 90, then
back to 0 BUT character rotate correct, without that changing direction and blocking like you can see on video. So its not connected with gravity (in my opinion), but with pitch rotation. Maybe its connected with FindLookAtRotation, but I dont know any other function that gives me similar result.

Thanks for help and (maybe little late) Merry Christmas :slight_smile: