Melee Combat System Question
I'm doing a multiplayer melee combat system where the enemy has to be overlapping a sphere collision in order to do damage to him. Here's a picture of the setup:
The attack event is called from a notify event at a certain point of the punching animation. This is what the attack event looks like:
At the moment I can damage the other player when he steps into the collision. But I can also damage him after he leaves the collision. So my question is, what would be the best way to see if there is someone colliding with the sphere? I honestly have no idea how to create logic that would constantly be checking for it.
asked Oct 07 '16 at 07:48 PM in Blueprint Scripting
I hope ive understood your problem, this is a quick thing I came up with which might be a solution. I create a timer by event and set it to loop, then you make that timer a variable so you can clear it later on, then using the node 'get overlapping actors' you can filter for the other player type, and by getting the length of that array you can detect if they are still within the attack range, I think this will be better than just cancelling it using a EndOverlap as it means you can have multiple people in the attack range and someone leaving the range won't prevent you from attacking! If there is no-one in the array, then it clears the timer and unsets the bool so the timer can be reactivated. Otherwise you can loop through the array and make them attack-able.
It might need some changing around to get it working on a server, but I hope this helps!
answered Oct 07 '16 at 08:38 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here