I created two rooms where you started, went through a door, turned left, and had to go through another door. Struggled a lot trying to figure out how to open the door due to the rotation. One door at closed was 90degree, while another closed was 180degree. So hard coding an open of say 90degree may have worked for the door at 180 degree, but that was the starting Yaw of the one door, so it didn’t “open” the door." Tried a lot of things and finally found this.
-
Declared these in the header:
FRotator StartingRotation;
FRotator OpenRotation; -
Set this in BeginGame:
StartingRotation = Owner->GetActorRotation(); -
Set this in OpenDoor:
OpenRotation = FRotator(StartingRotation.Pitch, StartingRotation.Yaw + 90.f, StartingRotation.Roll);
Owner->SetActorRotation(OpenRotation); -
And then in CloseDoor I just SetActorRotation(StartingRotation).
I had about 40 crashes before I figured it all out and I’m sure it’s not perfect, but it worked at the end!