- Home /
Multiplayer Walk animation playing for opposite person
Hey everyone! I'm not very new to Unity, but this is the first time I've made a successful multiplayer game. When I walk in multiplayer, it shows the other player walking, and the other player doesn't see the animation. I think this has something to do with global and local stuff (I want the animation to be visible for both players though). Does anyone know how to fix this? Here is the animation script I'm using.
function Update() {
var v = Input.GetAxis("Vertical");
if(Mathf.Abs(v) > 0.1f) {
animation.CrossFade("Walk");
}
else animation.CrossFade("Idle");
}
The code in your Update() function have nothing to do with networking, animations is applied for local player only. You have to attach a NetworkView component, use RPCs to send the animations state or serialize animatios state.
Your answer
Follow this Question
Related Questions
Network animations 2 Answers
Networking Animation problem 1 Answer
Multiplayer Animating 2 Answers
Network Animator not syncing with Clients in Netcode 0 Answers