For those of you who made multiple doors at different angles

If you have multiple doors at different angles, i.e.90degrees

Make the (UProperty EditAnywhere) for OpenAngle and a new CloseAngleangles

Then if you go into each door’s OpenDoor component you can change them to what rotation they need. The engine apparently stores separate values for eachgoingaheadgoingahead1

Hope this helped, and thanks for any feedback.

1 Like

Thanks for the tip. I would add that you need to change your code to

Owner->SetActorRotation(FRotator(0.f, CloseAngle, 0.f));

if that wasn’t obvious, in your CloseDoor function.

2 Likes

I prefere to read the Closed Position in the BeginPlay Function so I don’t have to care about the closed angle during the design process.

You can also add the OpenAngle to ClosedAngle in OpenDoor() function to use it as offset instead of using it as a fixed position.

void UOpenDoor::BeginPlay()
{
	Super::BeginPlay();

	ActorThatOpen = GetWorld()->GetFirstPlayerController()->GetPawn();

	// The Owning Actor
	Owner = GetOwner();

	ClosedAngle = Owner->GetActorRotation().Euler().Z;
}
1 Like

I did something similar. I declared InitalYawRotation as a float in the header file.
Capture

1 Like

Privacy & Terms