Sorry for the late reply, I’m falling behind on other projects…
Your point does make sense to me. I guess what I am trying to do is make sense on why the the Lerps character in the Third Person Networking sample (from the resources section on the unity website) does not seem to play the “walk, run, jump, etc” animations properly on networked machines.
I tested this on different machines and on different networks and I always seem to get the same result (looping walk cycle only, no other animations).
Looking through the code in the sample, it seemed to me that the "ThirdPersonSimpleAnimation.js: contains this:
// Fade in run
if (currentSpeed > marioController.walkSpeed)
{
animation.CrossFade("run");
// We fade out jumpland quick otherwise we get sliding feet
animation.Blend("jumpland", 0);
SendMessage("SyncAnimation", "run");
}
My thought was that this:
SendMessage("SyncAnimation", "run");
tells the “NetworkSyncAnimation.cs” script to change the animation state here:
public AniStates currentAnimation = AniStates.idle;
public AniStates lastAnimation = AniStates.idle;
public void SyncAnimation(String animationValue)
{
currentAnimation = (AniStates)Enum.Parse(typeof(AniStates), animationValue);
}
So basically what I did was substitute the sample code with the code you posted (thank you for this by the way)
So I guess my main question was:
- Does the network sample work correctly for anyone else?
- If so, what exactly are you doing to make it work properly?
And my new question is:
1)Clearly I am not using your code properly. Are you telling me that the “ThirdPersonSimpleAnimation.js” is actually not necessary to make the network animations work properly?
Thank you again for your help on this.