Download

A perfectly timed counter attack?

Hello i am trying to make a project with some combat ideas from the game Samurai Gunn, if your unfamiliar i attached a link of some gameplay.
https://www.youtube.com/watch?v=rGKOUazkl9E#t=784

What im basic trying to work out, is how i could blueprint when/if two swords collide at a precise moment that we negate eachother like in the gameplay footage, so that neither player takes damage and is just knocked back.
Also adding the current screenshot i have for my attack

If overlapping actor “Is Attacking” == True, do knockback. Wouldn’t that work? Just checking if the other player is attacking.

How would i make that work from there?
after the cast doing another branch? or after the for each?
how would i check that if the other player is overlapping and attacking?

After you know they are overlapping. Then you check if they are attacking as well.

The delay you have after turning on “Is Attacking” is the amount of time each player has to attack at the same time. So currently there is a 0.2 sec window for both players to attack at the same time.

Edit: Btw, I’m have been assuming the other player has the exact same set up as this blueprint.

Oh okay i see what you mean :slight_smile:
and yeah they have the same controls and functionality, however how would i tell the difference between the player that is attacking IsAttacking value and the player defending? or shouldnt that matter?

If you get “Is Attacking” out of the actor from your for loop, it will be that actors variable not yours. You’ll have to make that variable public to see it(the eye icon). Unless you’re using 4.7, then you shouldn’t have to do that.

Something like this.

Thank you i will try this out :slight_smile:

Can you think of a way that the check doesnt include the player that is doing the initial hit?
In my testing it counts the player hitting as also being hit/taken into account for the hit :S

Are you saying the player is one of the overlapping actors? You could do a if actor not equal to self. Prob a cleaner way of doing that but… yeah.

Yeah the player is one of the overlapping actors thats a problem,
should i do that before or after the loop?

You can do it as you check if they are overlapping.

Edit: I suppose the collision check is already done so ignore that part. :smiley:

Thank you, your being very helpful
getting any interesting result that i thought i should share, even if the player is within the appropriate collision sphere (this may be changed to sword collision hit down the line) and clicked,
it will still come up with one hit and one miss
as the pictures show, any idea why?


Get rid of the random bool and the “and”. That was an example you didn’t even need.

It loops through all actors no matter if one hit or not. So in this case it will always fail when the actor is self. Which is good.

Acquired two controllers and tested this out properly and it doesnt work.
It just destroys the second player who is trying to block.