So I was just trying to make a door like Resident Evil 7. It kind of works. That’s until you walk in the door the other side, the door seems to break all rules of physics and decides to rotate through the wall… Or basically rotates the wrong direction.
Also, the door is based on Physics and has a box collision surrounding it. When the player ends overlap. it fires this code.
i get this. however you seem to have looked over that i disable physics when the timeline starts and when it finishes. i re-enable it. however this isn’t about set rotation. it’s about it rotating the wrong way instead of it not rotating to the right position.
So what I’m guessing is the reason it’s going the right way the first time but going the opposite way gives it extra movement, is because you’re taking the current rotation and adding 150 degrees to the Z axis- so the SECOND time it’s going to +300.
Try throwing a clamp on there, and instead of relative use set actor rotation!
So. i looked at it. set actor rotation doesn’t work as i’m just rotating only the door mesh. i also have a box collison in there. that i dont want to be rotated.
as far as clamps go. i’m not familiar with clamps. could you maybe explain it to me or have some sort of documentation or video explain it for me?
So a clamp makes sure a value that is input does not go above a certain level or below a certain level. So for instance, a Float clamp with minimum set at 50 and maximum set at 300:
In goes float-> 200: Passes through just fine with no changes as it is greater than 50 and less than 300.
In goes float → 360: As it is above the max of 300, it is set to the 300.
In goes float → 75: passes through no changes.
In goes float → -25: As -25 is below the minimum, it is set to the minimum (50)
Since you’re only rotating the mesh, yes you want to use relative. If you want to rotate it the opposite way, you need to use a boolean + branch and determine which direction the player is coming from.