Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Feedback NetworkAnimator should not require an animation component.

Discussion in 'Netcode for GameObjects' started by hoesterey, Feb 10, 2022.

  1. hoesterey


    Mar 19, 2010
    While its easy to make this modification and remove: [RequireComponent(typeof(Animator))], it should not have that requirement.

    The reasoning:
    1) you have to reference the animation component in editor anyways. (it doesn't just "get component"
    2) For larger projects I think it is going to be a common practice to have a small amount of network prefabs and spawn "visuals" independently.
    -Spawn network object
    - network object creates visuals on clients.
    - Network object drives visuals on clients.

    it is simply not practical to have a list of network prefabs for every enemy art/projectile/animated item variant. Imagine an RPG with hundreds of enemy types.

    I Recommend removing the Animator component requirement. Also I'd consider a better more scale-able and less error prone way to define NetworkPrefabs. I can't have a team of 100 all adding content to the game and touching the same prefab list.
    Last edited: Feb 10, 2022
  2. Devseba


    Feb 26, 2021
    I'm dealing with issue right now.

    It seems I need to reorganize the avatar prefab with its parent. Or maybe attaching it with code.

    The Boss Room demo is not following the requirement of the Animator component either: it is not attached in the same object.
  3. Dzzyxx


    Jun 7, 2021
    I made an empty network object which would be the blank avatar root pretty much, all my main player network scripts would go on it, when i wanted to change avatar i made a clientrpc to tell the players which one to instantiate under that cartain empty object.this would allow me to keep one player prefab on the network prefab list but have an char model spawned under it. Im going to try this one a weapon script which would be a empty placeholder for a weapon and i would make a clientrpc to put the model under the empty networkgameobject.
  4. RikuTheFuffs-U


    Unity Technologies

    Feb 20, 2020
    Hi @hoesterey, thanks for the feedback! Would it be possible for you to open a feature request here? In this way, the team behind Netcode For GameObject will be able to prioritize your features, and you'll be automatically updated about their status :D

    (Same for this one)
    hoesterey likes this.
  5. cerestorm


    Apr 16, 2020
    RikuTheFuffs likes this.