Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Resolved NetworkAnimator ResetTrigger not working properly on client-side.

Discussion in 'Netcode for GameObjects' started by TestifyNow, Sep 30, 2022.

  1. TestifyNow


    Feb 9, 2016
    Consider two animations: Idle and Run

    I switch to Run/Idle via triggers from code, on OwnerNetworkAnimator (client-side authority)

    I set triggers like this:
    Code (CSharp):
    1. ownerNetworkAnimator.SetTrigger("Idle");
    and it seems to work, but sometimes, due to (probably) lag, the trigger for Idle stays "on" even while in Idle.

    In a normal game, this issue can be solved by Resetting trigger, so that's what I did here.
    The problem is, it doesn't seem to work at all like intended. Instead of setting the trigger to false, it seems trigger it on and off, or just on. Moreover, the animation seems to work fine on the server, but on client, it glitches out.

    My current workaround is so to first call all those on OwnerNetworkAnimator, and then on animator directly locally, but hey, why is it needed in the first place?
    Last edited: Sep 30, 2022
    modaka-cov likes this.
  2. modaka-cov


    Jul 5, 2021
    I'm also facing the same issue.
  3. RikuTheFuffs-U


    Unity Technologies

    Feb 20, 2020
    Triggers are currently not synchronized over the network by the NetworkAnimator. You need to use an RPC to change them.