Getting a fatal error in Unreal BuildingEscape project

Everytime i press play with this code activated

	if (GetWorld()->GetTimeSeconds() - LastDoorOpenTime > DoorCloseDelay)
	{
		CloseDoor();
	}

Unreal crashes and gives me a bug report, I don’t see what wrong with the code could anyone help?

1 Like

I found what was causing the problem

here is what I had

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

	AActor* Owner = GetOwner();

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

}

Here is what I needed

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

	Owner = GetOwner();

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

}

Privacy & Terms