I have a simple question. What would be the best way for a blueprint that has a collision box to check if the player is within?
I am trying to create a trap that runs damage during 2seconds each 2 seconds and loop. I need the trap to check if someone is there while its activated and if the player is there - apply damage. Any suggestion?
You could put a print string in there so when something like the pawn collides it’ll print out a line of whatever you type in the box. Print string is a handy node I use often to check if things are working because the screen can get cluttered when running a debug on a blueprint to see the paths running and checking the sequence of events.
OnBeginOverlap and OnEndOverlap.This events should help you. When player enters the trigger box OnBeginOverlap is triggered, if he leaves the box then the OnEndOverlap is triggered.
You can always get the x,y,z of the triggered box, box possition in world and manualy check if player is inside. This option should be used when you are spawning actor inside the trigger box, otherwise there is no point of it.
You add a tag like, “TriggerArea_Menu” in the triggers default settings. Then in the character BP you check if the chracter is recieving that tag. With an IF statement you then check if tag == “TriggerArea_Menu”, if so true you add what you want to happen.
Edit;
And also in the Char BP you drag a branch from the begin overlap, and as its bool statement you check if the overlap has the same tag. so in the branch the bool statement is if overlapping “actor has tag” == to the tag you want
So i don’t know if this is exactly what you need.
But here is my solution. (using Unreal since 3 weeks :)) #
If u try to give damage i think u should use the pain volume instead of the trigger box i used.
There Is An Easier Way You Can Check If Player Is On Trigger
You Can Say If Player Is On Trigger Give To A Boolean “True”
And When He Leaves The Trigger Give The Boolean “False”
Here Is A Screenshot
,There Is An Easier Way You Can Check If Player Is On Trigger
You Can Say If Player Is On Trigger Give To A Boolean “True”
And When He Leaves The Trigger Give The Boolean “False”
Here Is A Screenshot