Door opens alone (

My door opens as soon as I press play and before I even eject from the pawn and associate the OpenDoor component with the Pawn. I moved the DefaultPawn and the pressure plate away from each other and they are not connected so that should not be what triggers it. I even thought that the floor may be the one triggering the opening of the door so I put the pressure plate high in the air so it doesn’t touch anything, but still the door opens automatically as soon as I press play. My code is as shown in the video:

==================
OpenDoor.h
private:
UPROPERTY(VisibleAnywhere)
float OpenAngle = 90.0f;

UPROPERTY(EditAnywhere)
ATriggerVolume* PressurePlate;

UPROPERTY(EditAnywhere)
AActor* ActorThatOpens; // Remember pawn inherits from actor

======================
OpenDoor.cpp:

// Poll the Trigger Volume
// If the ActorThatOpens is in the volume
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor();
}

Any ideas why that might be happening? :slight_smile:

Your float OpenAngle = 90.0f; does not necessary have the same degree of turningpoint as the video has. It depends where you build the door. So check the door and adjust it to closed, note the degrees and use that number as the OpenAngle number. That worked for me.

I had this issue for a few moments.

Like me, you probably just forgot to delete the OpenDoor() method from the BeginPlay() function thingy so that when you start your game the OpenDoor method is called immediately and opens the door before you even get to the tick component thingy ever gets a chance for you to overlap with the trigger volume.

Not very eloquent but that’s the best I can word it right now haha.

2 Likes

Privacy & Terms