Rotating door bug?

So I’m busy with the Rotating door tutorial (Unreal Engine C++ Developer: Learn C++ and Make Video Games - 105. Exposing Parameters To The Editor) and I have made a door that is bewitched! We are tasked to make it possible to edit the variable of how much the door should open in the editor instead of in the code. So when I set it to 0-179 it works as intended but 180+ the door just spins in circles like this: (yes I missepelled yaw into Taw in my warning :sweat_smile:)

I think this is happening because the rotation goes from 0-179.9 then continues into -179.9(which is the same as 180.1) until it reaches 0 again. But what I do not know is how to fix this, can anyone explain to me if my theory is correct and if there is a way to fix this?

instead of trying to go over 180 trying going into the negatives, and make sure that your not adding any variables that would push it over 180. Just make sure no two variables are adding to be over 180, I had this same problem. Its an easy fix! :call_me_hand:

The best and easiest fix IMO is to have the static mesh as a child of the root component. Either by having another static mesh as the parent (like a door frame) or a scene component. That could be used to use relative rotations.

So if you have that hierarchy you could then use Get/SetActorRelativeRotation instead and it should work.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms