Context:
I’m trying to make a trigger volume such that when any actor leaves the volume they are teleported to another location.
Setup:
I’m creating this behavior by making a new blueprint class that derives from TriggerBox (I also tested this with a blueprint class that derives from Actor). Within the blueprint I have a Box Collision component to define the bounds of the volume. Additionally, I have a second component that I’ve created that finds the collision component and then binds to the OnComponentBeginOverlap event and OnComponentEndOverlap event. On the output of both events I have a print string to let me know when they trigger. The game starts with the player pawn inside the box collision.
Blueprint Actor Setup:
Blueprint Component Script:
[Blueprint on BlueprintUE](https://blueprintue.com/render/h2r25903/)Result:
The OnComponentBeginOverlap and OnComponentEndOverlap events both trigger immediately on the first frame of the game loading and then never trigger again regardless of how many times any actor moves into or out of the box collision.
Attempted Fixes:
Each fix described below had no effect on the problem with the one exception that is stated within it’s description.
- Turn on
Generate Overlap Events
on both the player pawn and trigger volume. - Set the trigger volume collision presets to
OverlapAllDynamic
orTrigger
and the player pawn’s collision presets toBlockAllDynamic
,OverlapAllDynamic
, orPawn
. - Add simple and complex collision to the player pawn.
- Set the
Custom Sleep Threshold Multiplier
to zero on the trigger volume. - Every frame move the trigger volume one pixel up and then one pixel down. This attempted fix causes the volume to think that the player is entering and then leaving the volume every single frame even when the volume continues to fully encompass the player during the movement.
- Move my script out of it’s own component and into the
Event Graph
of the blueprint itself. - Move my script out into the level blueprint graph.
Does anyone have any insight into this issue? It’s been bugging me for a while now and I can’t seem to figure out what’s wrong. I’ve scoured a ton of old forum posts and tutorial videos and none of their solutions seems to work. Is this even the correct way of doing what I want to do? Should I be using a different component for detecting if anything enters/leaves the volume?