setActorRotation always slightly off

When I use

setActorRotation(FRotator(0.0, 90.0, 0.0));

in my character class, it actually sets the yaw of my character to 89.999992. This is the same for -90.0, which gets set to -89.999992, and 180.0, which gets set to 179.999985. When i set it to 0.0 however, it works as expected.

I have no idea why this is happening, any help would be appreciated.

It might be a floating point rounding error. The numbers you’re passing to the FRotator are doubles and it takes floats, so it has to convert them. Try passing 0.f, 90.f, 0.f instead.

Hey Solus Peregrine,

We have a related issue logged. If you want to keep track of it, you can do so here: https://issues.unrealengine.com/issue/UE-28883