Question regarding Character to Character collision
Hey there. I'm trying to implement a sort of melee clash system where two characters who collide with each other will sort of clash and whoever wins the clash will perform an attack. The clash winner is determined by their current melee stance at the moment of impact. It's kind of like a rock paper scissors where stance A beats stance B, stance B beats stance C, stance C beats stance A. If both characters are on the same stance the clash results in a draw.
Anyway I'm overriding NotifyHit so that I can catch the event when the two characters collide with one another. Basically I want to evaluate the winner of the clash within this event by retrieving the melee stance of character A and character B (the other actor) and applying the rock paper scissors rule. I have it implemented like so:
So the idea here is to lock both players until the clash is resolved so that other players cannot initiate a new clash with either one of them. ProcessMeleeClash then returns an int32 value which is either 0 = LOSE, 1 = WIN, 2 = DRAW.
When I test this, the character I'm controlling who collides with a stationary character gets tagged successfully as the winner (i.e. ClashResult = 1) and that will cause the animation instance to play the corresponding melee animation since it sees that he is the winner.
My problem is that I was expecting the other character to get a ClashResult of 0 since he lost the clash, so that his animation instance would play a different animation to react to the melee animation played by the winning character, but it appears that the NotifyHit event only triggers on the character that was moving towards the stationary character as I'm only seeing a ClashResult of 1 on screen (Debug Message logged).
By the way, the following variables are replicated:
Perhaps it's a replication issue and I may be doing something wrong on the way I'm approaching this. Any ideas? I can provide more information if needed.
Follow this question
Once you sign in you will be able to subscribe for any updates here