I have a door that has 3 states closed partially open, open. I determine and switch between these states using the relative rotation of the door which is 0 when closed and 90 degrees when open. But if the door simulates physics and I rotate the door 90 degrees on yaw door tries to open in a weird side. This only happens when physics is enabled. You can see on the left top of the screen relative rotation of the door mesh which is false as it needs to be 0 when closed but is -90.
I tried many things but nothing seems to fix it please help.
First problem is our doors rotation value is wrong. So to get the correct rotation we create another dummy door that is invisible. And on event tick we get the world location of the original door, set dummies world location on that. Now they are moving together.
Next we use dummies relative rotation to do what we want to do. Here next problem comes. We cant set relative rotation of our door because it is simply incorrect. So we add actor rotation to our relative rotation to make it world rotation and set it there.