SetRotation() and GetRotation()

Hi, if i am using

self:GetEntity():SetRotation(Rotation.New(0,178,178))
print(self:GetEntity():GetRotation())

The console output is >0,178,178<, which is correct.
if i am using

self:GetEntity():SetRotation(Rotation.New(178,178,178))
print(self:GetEntity():GetRotation())

The console output is >2,-2,-2< instead, which is weird.
I tested some other number for pitch and it seems like this weird result always happens, when the pitch of SetRotation is between -90 and -180 or 90 and 180.

Something similar also happens with yaw and roll.

I don’t think this is a bug. It’s just the way that rotation are optimized internally. For example rotating 400 degress on one axis will be optimized as 40 degrees (400 - 360), but means the same.

Hey there @Ya_shi_shi !

I have confirmed with the Internal team and this is not a issue as Vilva has mentioned :slight_smile:

Thank you for still bringing it up to make sure :sun_with_face:

Thanks a lot to both of you. Yeah, EdC helped me a lot to understand what was going on there almost 2 years ago and i forgot about this thread :rofl:

Would delete it, but i am not sure how to delete topics in the forums :sweat_smile:

1 Like

We could always leave it here, incase other players may have that same question/issue and if they search the thread, they can fall on this and have their answer :slight_smile: