Sync animations

Options
Hi,

In our game we have a character with a specific set of animations: Idle, Run, Melee Attack and Ranged Attack. In particular, attacks are triggered by a button and their animations are short - we can perform a sequence of multiple rapid attacks. We're trying to sync the animations between clients but we are not able to find a reliable solution.

What do you suggest for a situation like this, where we have short and impulsive animations? AnimatorView seems to have some limitation in this case.

Thanks,

Devis

Comments

  • Devis
    Options
    In particular, our character is 2D and can face to the left or to the right. When we trigger an attack, the character must update its facing direction according to the attack direction. After that, he must play the attack animation. This attack animation raises an event that triggers a particle effect and damage calculation logic.

    How can we sync this kind of behaviour with a reliable solution?

    Thanks a lot,

    Devis
  • vadim
    Options
    Hi,

    Did you try to switch animations in RPC called by attacker when attack is triggered?
  • Devis
    Options
    Yes, but we have other problems. When we trigger an attack, the character must update its facing direction in order to match with the attack direction. Facing direction must be update during normal movement, with the animator or a simple data passed with OnPhotonSerialize...so, there's a conflict :sweat:
  • vadim
    Options
    Why do they conflict? Can you update direction in both cases? Is this network problem or you run in same issue with character attacking and moving locally?
  • Devis
    Options
    Normally I send the facing direction through a dedicated PhotonView (Unrealiable). If I set this value using also an RPC, an unreliable package can arrive after the RPC, right? In that case, it could be an old value...
  • vadim
    Options
    Yes, with Unreliable, message may never be delivered. So order of reliable/unreliable delivery does not make sense at all.
    Use Unreliable only for data which you can safely loose.