Please help correct the rotation error

You need to show the code for turning your character :slight_smile:

here is)

Well, that looks ok. Where do you print it?

Hi everyone, I’m developing a 2d game and I have a feature that sets my character to turn either 0 degrees or 180, I don’t have features where there would be other turn values, only 0 or 180. So, on the screenshot (on the left side of the game window) you can see that the rotation value is 178 degrees and I have no idea how it works, because I don’t set such numbers, UE4 decides that my character turns 178 degrees instead of 180. Please help me somehow to solve this problem so that I only have 0 or 180. Thank you in advance.

You mean where is this function called?

No, it’s the only function that spins the character, if anything, I call it at the time the character is spawned.

Oh, now I get it, sorry, English is not my native language, so I didn’t know what you were talking about right away.

Well, I can see you are setting it correctly, but where are you printing it out?

Does any other code rotate the player?

Ok, I see that. But when you did the print string and got 178, where did you put the node? Is it also look at the rotation of the sprite?

Hmm, nothing there either.

I notice the sprite is inherited. Is it possible something in the parent is moving it?

You’re modifying the relation rotation - are you intending to set the absolute/world instead? More than likely, you’re rotating it and the engine is “adjusting” the rotation along another axis.

Thank you, problem was solved)

I didn’t figure out how, but the problem was solved, I just took the advice that was given below and put the floor in and everything worked.
thank you for your help)

Bruh, it’s probably the noda floor, but I still don’t know where that inaccuracy comes from.