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.
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.
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.
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.
deleting the function Open Door() from
if (PressurePlate->IsOverlappingActor(PawnActorOpenTheDoor))
{
OpenDoor();-delete this and put instead the opendoor code
}
And will be work.
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.
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();
}
}