# Trigger Volume code crashing on Play

**URL:** <https://forums.unrealengine.com/t/trigger-volume-code-crashing-on-play/397478>\
**Category:** Platform & Builds\
**Tags:** crashing, ue4-crash, unreal-engine, Volumes, UE4, question\
**Created:** [July 15, 2017, 5:38pm UTC](https://forums.unrealengine.com/t/trigger-volume-code-crashing-on-play/397478 "2017-07-15T17:38:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Teph87](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teph87](https://forums.unrealengine.com/u/Teph87)\
**Post date:** [July 15, 2017, 5:38pm UTC](https://forums.unrealengine.com/t/trigger-volume-code-crashing-on-play/397478/1 "2017-07-15T17:38:46Z")

</div>

Just following a tutorial on volume triggers, the game started crashing when I press play I narrowed it down to this if  
statement in OpenDoor.cpp:

```
void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
	Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
	
	// Poll Door every frame, if actor enters trigger volume OpenDoor() 
	if (PressurePlate->IsOverlappingActor(ActorThatOpens))
		//THIS IF IS CAUSING THE CRASH[link text][1]
	{
	OpenDoor();
	}
}

```

OpenDoor.h for reference:

```
{
	GENERATED_BODY()

public:	
	// Sets default values for this component's properties
	UOpenDoor();

	UPROPERTY(EditAnywhere)
	class	ATriggerVolume *PressurePlate;

    UPROPERTY(EditAnywhere)
	class AACtor *ActorThatOpens;
	
	protected:
	// Called when the game starts
	virtual void BeginPlay() override;

	void OpenDoor();

public:	
	// Called every frame
	virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;

};

```

---

<div class="post-metadata">

**Author:** ![Teph87](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Teph87](https://forums.unrealengine.com/u/Teph87)\
**Post date:** [July 17, 2017, 6:34pm UTC](https://forums.unrealengine.com/t/trigger-volume-code-crashing-on-play/397478/2 "2017-07-17T18:34:16Z")

</div>

I just swapped PressurePlate with ActorThatOpens and it worked, still dont know why

---

<div class="post-metadata">

**Author:** ![M.Chat1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@M.Chat1](https://forums.unrealengine.com/u/M.Chat1)\
**Post date:** [April 14, 2022, 4:22pm UTC](https://forums.unrealengine.com/t/trigger-volume-code-crashing-on-play/397478/3 "2022-04-14T16:22:00Z")

</div>

Thanks for the help. I had the same one.
