Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

NetworkAnimator is basically nonfunctional

Discussion in 'Multiplayer' started by Lork, Feb 21, 2016.

  1. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    Animation parameters are for some reason organized in pairs; setting or unsetting one to auto send, whether by script or in the inspector will do the same for another parameter further down the list. In gameplay, the inspector will show the status of the first four parameters in the animator. Not the first four you picked to auto send, just the first four in the animator. The parameters that get sent across the network appear to be a random/arbitrary assortment that has little or nothing to do with either what the inspector shows or (more importantly) what you actually picked. Completely useless.

    Are there any plans to make this thing actually do what it says it does? Has anybody managed to get it working in any useful capacity?
     
  2. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    It actually works exactly as it's explained. You're not doing something right. The only function of the NetworkAnimator that isn't working properly right now is the synchronization of Triggers.
     
  3. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    It does not in fact work exactly as it's explained, unless you can explain what I'm not "doing right". Triggers actually do appear to work reliably provided you win the auto send lottery and they happen to be among the parameters that get synchronized.
     
  4. Karmak

    Karmak

    Joined:
    Jan 20, 2014
    Posts:
    9
    It also works for me, no problem.
     
  5. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    No one can explain what you're doing wrong, unless you explain what you're trying to accomplish, and how you're going about it.
     
  6. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    I attached NetworkAnimator to a gameobject with an AnimatorController and a NetworkIdentity and spawned it as a player in a network game. Even without enabling a single parameter to auto send, a random assortment of parameters can be observed as being synchronized over the network. Are there any additional steps I should be following to "do it right"?

    I suppose I'm just assuming that the boxes you can tick in the inspector control which parameters are synchronized, since there's no documentation available to explain it.
     
  7. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    Yes. The check boxes on the NetworkAnimator component are set to auto-send when checked. By default, they're all checked.
     
  8. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    That has never been the case for me. Every time I've added a NetworkAnimator, all of the boxes have been unchecked by default.

    Anyway, I found a way to reproduce at least some (probably all) of the issues I described in a test case. It seems that if your AnimatorController has 33 or more parameters, NetworkAnimator can't handle it at all, so you get these erratic results.

    It would be extremely disappointing if NetworkAnimator only supported AnimatorControllers with less than 33 parameters (even if you only wanted to synchronize one of them!), but even if that were the case there should at the very least be documentation and error messages stating as such. I've submitted a bug report, so we'll see how that goes.
     
    Last edited: Feb 22, 2016
  9. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    Okay. That might explain things. I've never had anywhere near 33 parameters on an Animator. Maybe look into condensing some of those in layers?
     
  10. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    Trying to reuse parameters like that would get incredibly complicated and unwieldy. At that point it would be easier to implement animator synchronization myself, which is something that I would prefer not to do, but will if I have to.
     
  11. DRRosen3

    DRRosen3

    Joined:
    Jan 30, 2014
    Posts:
    683
    I suppose that's all on developer skill level / experience. Like I said. I get away with using nowhere near 2 dozen parameters, and I have HUNDREDS of player objects.
     
  12. Lork

    Lork

    Joined:
    Jul 12, 2013
    Posts:
    79
    I'm not sure what the number of player objects you have has to do with it. The number of parameters required by an AnimatorController is a function of the number of animations used by one object. In my case I have a human like character that can exist in several different states and can perform a diverse array of discrete actions, which adds up to require a large amount of parameters to control it all in a sane way.