Open all the doors!

Thought I’d do some extra work to make sure it can open no matter which direction it’s facing as long as the door is vertical / upright. I could do the extra work to figure out if the door is upright so that we could adjust the door further, but that would take a bit more math than what can be accomplished in 30 minutes, so I’m going to stay focused on the course instead.

	Super::BeginPlay();

	float MyFloat = 90.f;

	// By still Getting this, we can make the door open relative to it's current position, instead of as an absolute rotation to the game
	FRotator CurrentRotation = GetOwner()->GetActorRotation();
	FRotator OpenDoor = {
		CurrentRotation.Pitch,
		CurrentRotation.Yaw + MyFloat,
		CurrentRotation.Roll
	};
	
	GetOwner()->SetActorRotation(OpenDoor);

!

3 Likes

Wow the textures you choose are amazing!

This route led me to a conclusion where all the doors would open, and then continue to open. Still I was able to refactor the lesson code to something that I agreed with, so that’s fun :slight_smile:

Privacy & Terms