Search Unity

One of the animation doesn't sync properly

Discussion in 'Multiplayer' started by Hostur, Feb 27, 2017.

  1. Hostur

    Hostur

    Joined:
    Jul 6, 2015
    Posts:
    60
    Hi,
    My player is sync through Rigidbody3d and NetworkAnimator.

    Every animation is sync well except one. It is short animation of slashing sword.
    When player atacking someone, he stay near the second player and performs slashing.

    On the local client animation looks how I except but on the "being beaten" only the first hit is sync properly.
    Than, if atacking player doesn't move, slashing is not synchronize (only atacking client see animation of slashing).

    If I move around attacked player then both of them sync animations.

    I triggering animation like this
    Code (csharp):
    1.  
    2. [TargetRpc]
    3. public void TargetSetHitAnimation(NetworkConnection connection)
    4. {
    5.   // It is integer because it will be randomized for more animations
    6.   SetIntegerValue(HIT, 1);
    7.   StartCoroutine(SetIntegerWithDelay(HIT, 0, 0.4F);
    8. }
    9.  
    10. private void SetIntegerValue(string animation, int value)
    11. {
    12.   _animator.Setinteger(animation, value);
    13. }
    14.  
    15. private IEnumerator SetIntegerWithDelay(string animation, int value, float delay)
    16. {
    17.   yield return new WaitForSeconds(delay);
    18.   SetIntegerValue(animation, value);
    19. }
    20.  
    So this code is triggered for example once per 1.5 sec.

    Can anyone help me to understand why it doesn't works well if players doesn't move?
     
    Last edited: Feb 27, 2017
  2. Hostur

    Hostur

    Joined:
    Jul 6, 2015
    Posts:
    60
    It looks like Network Animator's bug. "HIT" animation have 4 entry parameters from "combat idle state"
    1. Hit > 0.
    2. Hit < 2;
    3. CombatMode = true;
    4. OneHandWeaponAttached;

    And it works fine when im on local client as i mentioned. Entry from Walk/Run state is pretty the same but works better,
    because from walking/running state animation is synchronize better then from combat idle. Is it related to rigidbody sync?

    I can't understand why the currently displayed animation that should be synchronized - isn't. Please anybodoy?
     
  3. Hostur

    Hostur

    Joined:
    Jul 6, 2015
    Posts:
    60
    After 3 days I'm sure it is a bug and I reported it.
    I'll inform here when it will be fixed.
     
  4. Hostur

    Hostur

    Joined:
    Jul 6, 2015
    Posts:
    60
    Hi, More then two weeks passed but I have no response for this bug from unity support. Anyone had similar problem here? On of the animator parameter is not synchronize properly