network animator not synching animations

So my issue is that even with a network animator and all of the boxes checked the animations are still not seen by other players. my script for attacking works as follows. So im wondering how can i edit my script to properly sync the animations?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class clickattack : NetworkBehaviour  {
    public GameObject targeting;
    public GameObject sword;
    public float strength;
    public Animator anim;
    public bool canclick;

    IEnumerator attackisopen()
    {
        canclick = true;
        GetComponent<Attackdirection>().canattack = true;
        yield return new WaitForSeconds(10 * Time.deltaTime);
        sword.GetComponent<Gettindamaged>().candamage = true;
        yield return new WaitForSeconds(80 * Time.deltaTime);
        GetComponent<Attackdirection>().canattack = false;
        canclick = false;
    }

    void attacking()
    {
        if(Input.GetKeyDown(KeyCode.F) && canclick == false)
        {

            StartCoroutine(attackisopen());
            attackanimationsuccesful();
        }
    }



    void attackanimationsuccesful()
    {
        if (GetComponent<Attackdirection>().attackingleft == true)
        {
            anim.SetTrigger("Attackleft");
        }
        if (GetComponent<Attackdirection>().attackingup == true )
        {
            anim.SetTrigger("Attackup");
        }
        if (GetComponent<Attackdirection>().attackingright == true)
        {
            anim.SetTrigger("Attackright");
        }
        if (GetComponent<Attackdirection>().attackingdown == true)
        {
            anim.SetTrigger("Attackdown");
        }
    }


    // Use this for initialization
    void Start () {
    }



    // Update is called once per frame
    void Update () {
        if (!isLocalPlayer)
        {
            return;
        }
        attacking();

    }
}

Not using NetworkAnimator: (Note, I have Not compiled the code. Just wrote it in Notepad. Excuse any errors)

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class clickattack : NetworkBehaviour  {
    public GameObject targeting;
    public GameObject sword;
    public float strength;
    public Animator anim;
    public bool canclick;
    IEnumerator attackisopen()
    {
        canclick = true;
        GetComponent<Attackdirection>().canattack = true;
        yield return new WaitForSeconds(10 * Time.deltaTime);
        sword.GetComponent<Gettindamaged>().candamage = true;
        yield return new WaitForSeconds(80 * Time.deltaTime);
        GetComponent<Attackdirection>().canattack = false;
        canclick = false;
    }
    void attacking()
    {
        if(Input.GetKeyDown(KeyCode.F) && canclick == false)
        {
            StartCoroutine(attackisopen());
            attackanimationsuccesful();
        }
    }
  
    [Command]
    void Cmd_Animate(string trigger)
    {
        Rpc_Animate(trigger);
    }
  
    [ClientRpc]
    void Rpc_Animate(string trigger)
    {
        anim.SetTrigger(trigger);
    }
    void attackanimationsuccesful()
    {
        if(!isLocalPlayer)
            return;
      
        if (GetComponent<Attackdirection>().attackingleft == true)
        {
            anim.SetTrigger("Attackleft");
            Cmd_Animate("Attackleft");
        }
        if (GetComponent<Attackdirection>().attackingup == true )
        {
            anim.SetTrigger("Attackup");
            Cmd_Animate("Attackup");
        }
        if (GetComponent<Attackdirection>().attackingright == true)
        {
            anim.SetTrigger("Attackright");
            Cmd_Animate("Attackright");
        }
        if (GetComponent<Attackdirection>().attackingdown == true)
        {
            anim.SetTrigger("Attackdown");
            Cmd_Animate("Attackright");
        }
    }
    // Use this for initialization
    void Start () {
    }
    // Update is called once per frame
    void Update () {
        if (!isLocalPlayer)
        {
            return;
        }
        attacking();
    }
}

Any questions regarding the code, let me know

just to verify the [Command] synchronizes it to the server and [ClientRpc] synchronizes it to all the other connect clients correct?

Mark a method with Command and when you call it. A packet is sent to the server instructing it to run the method. So basically what’s in the Command method is server code. Rpc is same but flipped.
So sent from server to clients to run said code.

script works perfect just has to remove the inital anim.(“attack[direction]”)

I would not do that. That will cause latency for the local client doing the animation. I would do this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class clickattack : NetworkBehaviour  {
    public GameObject targeting;
    public GameObject sword;
    public float strength;
    public Animator anim;
    public bool canclick;
    IEnumerator attackisopen()
    {
        canclick = true;
        GetComponent<Attackdirection>().canattack = true;
        yield return new WaitForSeconds(10 * Time.deltaTime);
        sword.GetComponent<Gettindamaged>().candamage = true;
        yield return new WaitForSeconds(80 * Time.deltaTime);
        GetComponent<Attackdirection>().canattack = false;
        canclick = false;
    }
    void attacking()
    {
        if(Input.GetKeyDown(KeyCode.F) && canclick == false)
        {
            StartCoroutine(attackisopen());
            attackanimationsuccesful();
        }
    }
    [Command]
    void Cmd_Animate(string trigger)
    {
        Rpc_Animate(trigger);
    }
    [ClientRpc]
    void Rpc_Animate(string trigger)
    {
        if(!isLocalPlayer)
            anim.SetTrigger(trigger);
    }
    void attackanimationsuccesful()
    {
        if(!isLocalPlayer)
            return;
    
        if (GetComponent<Attackdirection>().attackingleft == true)
        {
            anim.SetTrigger("Attackleft");
            Cmd_Animate("Attackleft");
        }
        if (GetComponent<Attackdirection>().attackingup == true )
        {
            anim.SetTrigger("Attackup");
            Cmd_Animate("Attackup");
        }
        if (GetComponent<Attackdirection>().attackingright == true)
        {
            anim.SetTrigger("Attackright");
            Cmd_Animate("Attackright");
        }
        if (GetComponent<Attackdirection>().attackingdown == true)
        {
            anim.SetTrigger("Attackdown");
            Cmd_Animate("Attackright");
        }
    }
    // Use this for initialization
    void Start () {
    }
    // Update is called once per frame
    void Update () {
        if (!isLocalPlayer)
        {
            return;
        }
        attacking();
    }
}

yes i have noticed that is an issue but with the original script it worked perfectly but the animation activated twice

Yes, the updated one I posted doesn’t play twice but has no latency.

oh i see why now thanks for the edit. is there a way to further reduce the time between when the animation starts on your client and the other client. i noticed even edited theres still some issues with a delay between when the animations both started

No, That’s latency and can NEVER be resolved. Usually refered to as “ping” in video games.

ah ok makes complete sense figured id ask as i know that unity deals with some more complex concepts such as the send rate and such but if its just regular ping then ill have to deal with it some other way