- Home /
Playing Animation over Network
My animation for a gate opening plays on the client, but no one else in the network game can see it. What should I add to mys script to make it play. as of now im using animation.Play("ewhatever");
Answer by AngryOldMan · Feb 27, 2011 at 11:50 PM
You need to send an RPC to everyone to say that the animation is playing, then the RPC will be called on a lacal machine, so you don't actually watch it over the network, someone over the network turns it on then sends a message to your machine to turn it on for you. need more info? check out http://www.m2h.nl/unity/ and take a look at the network example. there is some more info and a forum for this here http://forum.unity3d.com/threads/75385-Ultimate-Unity-Networking-project-Add-multiplayer-to-your-game-today!
Answer by FuzzyQuills · Apr 15, 2014 at 10:57 AM
Try this:
@RPC
function AnimateNetwork (clip : String){
currentAnim = clip;
anim.Play(clip);
}
function Update () {`
currentAnim = "Run";
animation.Play("Run", 0.2); networkView.RPC("AnimateNetwork", RPCMode.AllBuffered, currentAnim);
}
Trust me, it's that simple, yet it works! this however only works for the legacy animation system, not mecanim. (Apparently, Mecanim is very hard to sync on the network!)
Your answer
Follow this Question
Related Questions
Networking Animation problem 1 Answer
Network animations 2 Answers
Can the animation editor create local rotational data? 3 Answers
Synchronizing objects over the network 4 Answers
Adding animation clips via script 2 Answers