I’ll try to narrow this down so this makes sense, I’m working with a listen server (open map?listen) off of two computers.
Server Project File:
I set up PlayerBP to play a JUMPING animation sequence on keypress C - replicated with Run On Server.
Replication looks good on a quick two window Server/Client test.
Client Project File:
Copy/pasted project file, same PlayerBP
But on the client project file, I SWAP the JUMPING animation for a RUNNING animation.
So when I connect both PCs to the map and press C, on the Server PC the client’s pawn is playing the server JUMPING ANIMATION (instead of running).
And when I press C on the client’s PC, the server’s pawn is playing the client RUNNING ANIMATION (instead of jumping). This is basically causing a “mirror effect” with both pawns.
There’s some weird issue where upon animation activation, it just plays the animation stored in the projects BP.
Am I not supposed to switch blueprints around in a multiplayer project? All I’m doing is replacing the jumping animation with the running animation.
I think this is either a controller issue, or a replication issue, which one would you say it is?
Hi Kvackie, thanks for the response. I uploaded a YouTube video showing my project and its blueprints:
At the end of the video, when I show myself deleting the animations and “replacing” them with new ones, this is what I am doing on the client’s PC. I am replacing the jumping animation with a running animation, but leaving the jumping animation on the Server PC.
So when the client presses C, the Server sees the jumping animation on the client pawn.
If I’ve understood this correctly, you’re trying to play two different animations on the server and client? Since you’re using the same Pawn for both it will always play the same animation, there is nothing wrong with your code.
That’s correct, I would like to have two different animations stored on the client and server’s BP. If there is no issue with this, do I just need to create another pawnBP for a second player?
There are a few steps to it, but in short, yes. You’ll need to assign a pawn for Player 1(server) and one for Player 2(client). In there you must store the animation.
Thanks for the help Kvackie. I was wondering, do you know if the animation MUST be stored on the clients project? What happens if I my server has a different animation playing than what is stored in the clients blueprints, will it not be able to replicate something that is not stored?
The server can only use what information is available to it, if the client doesn’t have any animations then no animations are available. Your server can’t play a different animation than what is stored because it has to check what is stored to play it.
Why are you connecting to a server that has different code than the client? Is there some super advanced technical reason you’re using a different project file for your “client” machine? This is a very strange approach.
If you could explain what you’re trying to achieve doing this i’m sure it’d be easier to help.