Unreal Keeps Crashing When Using trigger Volumes Initially

Hello all,

While doing the “Using Trigger Volumes” lecture, I have added the code to poll the game every frame to determine when the pawn is overlapping the trigger volume -
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor();
}

this code is added to the UOpenDoor::TickComponent method. However, once this is added, whenever I go into Unreal and attempt to play the game it crashes immediately. I tried this a few weeks back with my much older, very outdated PC with the same effect so I upgraded the PC and it is still happening.

Has this happened to anyone else, and are there any suggestions? I am running with an i7 6700 CPU, 32 GB of RAM, and an R7 370 4GB video card.

Thanks any help is greatly appreciated!

You have most likely haven’t setup the PressurePlate in the details panel for the door. So PressurePlate would be a nullptr and then trying to access IsOverlappingActor from that would cause the crash.

Aha! Thank you! Somehow I missed that in the set up part of the lecture. Then I ran into another problem where I set it up for one door and not the others. Thanks again, that saved me some headaches.

Cheers guys, had exactly the same issue. Took me too long to check the forums! :slight_smile:

I am having the same crashing problem, i have confirmed multiple times my code matches and that i followed all steps but Unreal keeps crashing once i hit play.

Do you have more than one door with an OpenDoor component?

Yes, am i only supposed to have it set to 1 door at a time

Just diagnosing the issue. Have you set a trigger volumes on all of the OpenDoor components?

yes have pressure plate set to trigger volume on both doors

I’m having the same issue.

Both doors have the Trigger Volume set as the pressure plate, but every time I hit play it crashes.

Nope, I lied, I had a third door I forgot about and it didn’t have the Pressure Plate set! :stuck_out_tongue:

Thanks for the help guys! :smile:

1 Like

Hello guys,I found that if you select the pressure plate only on one door then the program won’t crash.I guess using pressure plate on more than one door will be fixed in a later video lesson.

It should be fine having multiple doors with the opendoor component as long as they have a trigger volume set.

1 Like

I had doors with OpenDoor all over the place - took me a while to delete then all.

How I solve the problem of crashing:

  • deleting the function Open Door() from
    if (PressurePlate->IsOverlappingActor(PawnActorOpenTheDoor))
    {
    OpenDoor();-delete this and put instead the opendoor code
    }
    And will be work.
1 Like

I’m having an issue with this crash too. For some reason in the Unreal Engine it won’t even let me set the Pressure Plate to anything, let alone a Trigger Volume. When I click to set it, the label and name section is blank. I’m not sure what I’m missing just yet.

YEA THTAS RIGHT I ALSO REPLACE MY OPENDOOR(); METHOD AND PUT INSTEAD THE CODE OF IT WHICH IS
{
// Find the Owning Actor
AActor* Owner = GetOwner();

//Creat a Rotator 
FRotator NewRotation = FRotator(0.0f, 65.0f, 0.0f);

//Set the Door Rotation 
Owner->SetActorRotation(NewRotation);

}

AND IT WORKED FOR ME THANKS BRO.

make sure you do not have “Super :: BeginPlay ();” in the OpenDoor function.

2 Likes

Just the ticket. Thanks.

Hello,

I think the problem here is with the pointrs initialization. It is necessary to be carefull with that, we only can access to the pointers if we initializate them. To avoid that problems it is necessary to do that:
if (PressurePlate && ActorThatOpens)
{
if (PressurePlate->IsOverlappingActor(ActorThatOpens))
{
OpenDoor();
}
}

Privacy & Terms