For anyone wanting to know what i mean ill talk you through it.
so first i wanted to know when the player is moving forward/Backward, Left/right or a combination of both. I tried multiple ways to do this using velocity, direction, axis input etc in the end i went for this setup for ease of use and flexibility.
so what i did was first create action mappings for each movment in the projects input settings like so.
so obviously you can see that when i press W i will be moving forward. S key moving backward, A key moving left and D key moving right. Normal game WASD controls.
then in my character BP i then checked these player inputs to see which one the player was pressing.
I then created a custom event in order to use these inputs as shown here
so for each custom event all i did was give them a name similar to the action inputs. I then made each event set a boolean value that will drive my animation blueprint.
so for each boolean i made them into a repnotify and inside each repnotify function i simply casted to the animation blueprint and set the boolean to be the same as the booleans inside the animation bp.
so here is the repnotify function for moving forward
as you can see whenever the boolean changes, the repnotify function is called and it simply sends the boolean value into the animation blueprint
inside my animation blueprint i simply have the booleans the same as in my character bp i just added ABP suffix on the end so that i can see that these booleans are from the animation blueprint.
And lastly i use these replicated booleans driven by my player input in order to drive my locomotion animation state machine
so for example here is the transition rule for when the player can move from idle into walk forward. as you can see i simply use the replicated boolean . it is really simple .
so the execution goes like this. player presses W on the keyboard >>>>> this calls the server RPC PlayerIsMovingForward custom event (run on server) >>>>>> this sets the boolean playerIsMovingForward inside the character blueprint to be equal to true. >>>>>>this variable is repnotified so it calls the repnotify function>>>>>> inside this function it casts to the animation blueprint and sets the variable playerIsMovingForwardABP to be equal to true>>>> once the boolean is set to true this causes the player to go into the walking forward animation inside the locomotion state.
here is a small video of the final result . first few mins is set as a dedicated server showing two clients. the second half odf the video is set to listen server showing server and one client connected.
as you can see the animations still work and are replicated wether it is a dedicated server or not
I had originally had this entire system set up using blendspaces replicated working fine but it is my personal opinion that although blendspaces are amazing and a lot quicker to set up overall using locomotion state machines gives you greater flexibility and control over youre animations and makes it easier to add and exstend them later on .
if anyone wants any help with replication or setting up a system like this drop me a pm and ill try to help when i can