Im making a multiplayer game where when a player presses a button on the HUD it calls that player to play an animation. My issue is when the server (Character1) calls it, the server sees it but the client doesnt. When the client (Character2) calls it both server and client see it.
This is the same script I use too replicate the movement of the players. Everything coded like this works fine except the playing of this animation. If I use the same script and add “Destroy Actor” node instead of play animation the actor destroys on both server and client. I have added print strings to debug and the script gets called fine. For some reason the animation is the only thing that wont play.
Just when I think I have multiplayer and replication sorted - something else strikes.
Any suggestions or help would be great. Everything else seems to work, character movement repliates fine both ways.
Thanks,
Ben
Hi, the only player controller that exists on a client is the player controller of that client, only the server has them all. Which means you would need to call your multicasts somewhere else (e.g. the pawn), not in the player controller.
For example, if the server calls MCChar1Heal or MCChar2Heal on the servers player controller, then it will only execute those multicasts on the server, since the player controller does not exist on any client. If the server would call it on a clients player controller, then it would execute on the server and that client, but not on any of the other clients.
Awesome, makes sense. The issue I have is that I dont actually hava a player character or pawn. I have spawned characters from class. The player will have control and choice over moving multiple players (turn based strategy), so if I dont out the code on the player controller not sure where else to put it.
I think I was suprised because movement of the character replicates this way but not the animations.
Will have to try calling the code elsewhere, will try casting to the character BP itself and see.
Thanks