Hey, im making a game where you have two players and both are able to double jump, I made an integer for both of them that keeps track of how many times the character has jumped and it resets when they hit the ground. I made a onhit event when it hits the ground and checks which character that it hit with and triggers the landing event inside the character blueprint. It works fine with both characters and triggers the event properly, however it only sets the 1st player’s integer to 0 while the 2nd player is stuck at 2 making it unable to jump again. The script is identical on both characters, only with different variables.
This is the jump script from the character blueprint. I have a custom event for each of the players called Landed P1/P2 and it sets the integer back to 0. Just to check that the events actually triggered i have a print string after the set integer node. Both prints gets exectuted, but the P2 Jump does not get set while P1 does.
And this is the onhit which checks which character it hit and launches the event accordingly.
I hope someone is able to tell me what im doing wrong or atleast tell me why this is happening