4
\$\begingroup\$

I am attempting to learn Unity Networking using the new UNET framework. I have a functioning rudimentary 3rd person setup in which a host and a client can connect to localhost:7777. Animations are working across both client and host. However, some of the animations are not smooth. I am using the ThirdPersonAnimationController and the Ethan model that come with Unity. The animations from running to turning left or right and from running to stopping are quite jittery. However, they are not jittery when viewing the screen in which the controls are being input.

I am using the NetworkManager and my Player prefab has a NetworkAnimator. I'm calling my movements in the Update function of my Player script:

void Update()
{
    param = anim.parameters;
    if (!isLocalPlayer)
        return;

    float move = Input.GetAxis("Vertical");
    anim.SetFloat("Forward", move);

    float moveTurn = Input.GetAxis("Horizontal");
    anim.SetFloat("Turn", moveTurn);

    Camera.main.transform.position = new Vector3(transform.position.x, 2, transform.position.z - 2.5f);

}

public override void PreStartClient()
{
    GetComponent<NetworkAnimator>().SetParameterAutoSend(0, true);
    GetComponent<NetworkAnimator>().SetParameterAutoSend(1, true);
    GetComponent<NetworkAnimator>().SetParameterAutoSend(4, true);
}

public override void OnStartLocalPlayer()
{
    // good for initializing things only for the local player: cameras, input, etc...
    GetComponent<NetworkAnimator>().SetParameterAutoSend(0, true);
    GetComponent<NetworkAnimator>().SetParameterAutoSend(1, true);
    GetComponent<NetworkAnimator>().SetParameterAutoSend(4, true);


}

Is there a way to improve the animation across the network? Any suggestions would be very helpful. Thanks.

\$\endgroup\$
  • \$\begingroup\$ Did you ever found an solution ? Got the same problem :c \$\endgroup\$ – genaray May 21 '17 at 14:04
  • \$\begingroup\$ Unfortunately, no. I've since halted on the project since the newtorking needs to be stable and I don't have enough personal time to devote to it. \$\endgroup\$ – John Murphy May 22 '17 at 17:27
  • \$\begingroup\$ Murhpy Thanks for your reply ! Its kinda strange ... ony all those tutorials it works seemless... hope they gonna fix that someday. \$\endgroup\$ – genaray May 22 '17 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.