We’ve re-vamped our blueprint code to better handle replication, but we’re curious as to where the animation replication nodes should be stored. The standard third person animation sets replicate animation automatically (walk animations), but when we want to sprint, crouch walk, throw punches, etc., the animations themselves don’t replicate unless we set them up.
We’re still learning that process, and we’d love to know the best place to put those nodes (The anim blueprint or the character blueprint?)
As a quick update, I think I’m getting the hang of this a little. I’ve been able to get my crouch animation replicating in one scenario - when I’m playing as the server, the client can see the crouch. However, when I’m playing as the client, the server cannot see the crouch. I did this by simply setting my crouch boolean to replicate. I’m now trying to figure out how to get clients to show this on the server.
This is actually a lot easier with typical variables (like spawning an actor) as it’s directly covered by the great tutorials (and honestly, makes more sense to me in general). However, AnimMontage elements seem to elude me. I tried creating a custom event that Runs on server (or multicast, I’ll try them all until they work) but then what could I do after that? It’s not like I can call AnimMontage elements directly in the Character class. How should I be communicating with the Montage (or Anim blueprint?)?
Crouching is a boolean that’s determined based on a button press in the IndigenousCharacter blueprint. That variable is set to replicated. That variable is also called in our Animation Blueprint and set to a local variable (because you can’t use execs in the state machines, thus you can’t cast to anything inside them). The local variable’s value determines what the State Machine does. I think this is the correct way to replicate animations, but I’d love a little feedback from Epic on this one to ensure we aren’t going to run into issues later.