So I’ve been working to implement a pretty basic deathblow/assassination system in my game. I’ve been using Box triggers for this task as it seems like the simplest and most effective option. The problem is, however, that somehow the player triggers an overlap event before actually overlapping. (see image for code setup)
I’ve tried a couple different iterations of this code to make sure that we are actually overlapping properly but I always get the same out come with the box triggering before the player overlaps. Any ideas what might be causing this issue?
You see, when you are casting it to some class you are actually do a check whether to actor is valid or not. So, you should use the return (blue circle) in casting node and not somewhere else.
Hmm but that doesn’t explain why it would activate before I actually enter the trigger. Not to mention I’d tried this before and doing some kind of is valid check never solved the problem. For whatever reason the box trigger (and all the other types) always trigger without my character actually walking through it.
It look like our Character have interaction capsule. This is not default option. So Character can interact with objects on distance. More radius of capsule - more distance to interact.
Do Print on who is Other actor.
Does it fire at the certain distance?
Make sure that you don’t have big Box/Sphere Collision Components on your character that can overlap with trigger.
I’m facing an unexpected problem with trigger overlaps.
Here’s the deal: Whenever my player character approaches the trigger area, the overlap event seems to trigger a bit prematurely, firing before the actual overlap occurs. I’ve scrutinized my code setup and tried different iterations, but I keep encountering the same issue where the trigger activates before proper overlap is established.
I ended up fixing mine:
I had a old box trigger on my character that I had set the visibility of to false, so I wouldn’t ever see it in the BP editor - just had to remove it and mine worked.
I had a similar issue with Box triggers! It could be the trigger’s bounds extending too far. Try scaling down the Box component slightly in the editor and test. Also, in your overlap code, add a debug print to confirm the overlapping actor is the player. Maybe the trigger’s hitting something else? What’s the environment around the trigger like?
You can try to print out what object is being registered. Simply drag off the actor component from the on begin overlap node and plug it into the print string node.
Thanks for the tip! I added a Print String node off the OnBeginOverlap’s actor pin, and it’s showing a nearby static mesh triggering it early. I’ll scale down the Box component and test. Any advice on filtering only the player in the overlap event?