Physics constraint on door breaking relative rotation values

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.

Hello guys, I fixed the problem :smiley:

So to start of I got my inspiration from macxike on this topic Relative rotation with physics constraints
but made something a little bit different.

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.

My BP has some more stuff that uses relative rotation and we use dummies relative rotation on that.

So it is working pretty nicely. Idk if this is good for performance or what but it gets the job done.

And oh not to forget we set dummy door to no collision because we dont want our door to twitch out.

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