How to Overlap a subObject?
I'm trying to do a Beat'm'up game, like GoldenAxe, StreetsOfRage ... etc
In the Blueprint of the Player I create a CapsuleCollision. My intention is to remain deactivated and when I attack it activates a few moments. If the BoxCollider reaches the enemy, it will hurt him.
How can I create an "Overlap Event" only from a sub-object of the Blueprint? "OnEventOverlap" refers to all the player's objects, I just want to do it with the BoxCollider that I created.
Maybe can be better create another BluePrint to do the Hitbox?
asked May 05 '18 at 07:07 PM in Blueprint Scripting
you want to use the on component begin overlap. to get this event you just need to select your hitbox collider, then right click it and select add event, then add oncomponentbeginoverlap. this will be a overlap event that only trigger when that component is overlapped. from there you will just need to define what you want to be able to trigger the script so that it doesnt get overlaps from things unintended like walls (this is optional but it is advised). in the example in the picture below i used a cast to enemy to restrict what other actors can be affected by this script, so basically only enemies will take damage or do whatever comes after the cast.
answered May 05 '18 at 07:19 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here