Hey guys, i’m having trouble with replication. When the left mouse button is pressed, the player needs to attack.
It seems that the Click event isn’t replicated. The functions only happen in your player, not in your friend’s player.
The animation blueprint shows an attack animation if this variable is set to true, but i’m sure that the problem isn’t with the animation blueprint because the another player doesn’t cause “damage” in the enemy.
This image shows what happens. The click event isn’t replicated. As you can see, the enemy died in the local machine, but in the another player machine, it’s still alive. Nothing related with this event happens. Please, anybody can fix this?
You didn’t provide enough information. Maybe because your english isn’t so good but it still makes it difficult to help you if you dont specify where your problem actually is as you may have several problems.
Attack and death Animation isn’t showing for clients only for the user initiating (and the server maybe)
Killed players still look like they’re alive to other players but dead to itself
Which is your problem? or both?
The second its many things. You need to search more on replication. It’s not so simple as a single variable. There are lots of threads on this.
The first issue can be searched too, but at a basic level,
CharBP: Set replicated Variable Attacking to True → AnimBP Cast to CharBP get status of “Attacking” Set new replicated variable in AnimBP called Attacking_anim to status of Attacking in CharBP.
Use animBP variable called Attacking_anim to control whether animations play or not play in AnimGraph or state machine. That should replicate the movement for all to see.