Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
This question was closed Sep 16, 2018 at 12:17 AM by wesleywh for the following reason:

Problem is not reproducible or outdated

avatar image
0
Question by wesleywh · Sep 02, 2018 at 08:49 PM · networkinganimatormecanim

UNet - Sync more than 32 parameters with "NetworkAnimator"

I have a "NetworkAnimator" component attached to my player but it has the following error:


NetworkAnimator can only select between the first 32 parameters in a mecanim controller.


I have more than 32 parameters in the mecanim controller. So MOST of the animations are synced up. So is there a way to make the NetworkAnimator component sync ALL parameters instead of just 32? Am I stuck with coming up with a solution of my own?


If I have to come up with a solution of my own is there a way I can dynamically collect the parameters from a target animator component and sync that across the network? I really don't want to have to write all of the parameters by hand as a [SyncVar].

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wesleywh · Sep 02, 2018 at 09:42 PM 0
Share

So I can't send a list over the network... sad... Here is what I am trying to do. If someone has a better way I am definitely all ears (This doesn't work because of my generic list):

 public class $$anonymous$$_AnimSync
 {
     public string name = "";
     public string value = "";
     public AnimatorControllerParameterType type = AnimatorControllerParameterType.Bool;
 }
 ...
 ...
 
 private void Update()
     {
         if (isLocalPlayer == true)
         {
             BuildAnimList();
         }
     }
 void BuildAnimList()
     {
         for (int i = 0; i < animator.parameters.Length; i++)
         {
             $$anonymous$$_AnimSync new_param = new $$anonymous$$_AnimSync();
             new_param.name = animator.parameters[i].name;
             new_param.type = animator.parameters[i].type;
             switch(animator.parameters[i].type)
             {
                 case AnimatorControllerParameterType.Bool:
                     new_param.value = animator.GetBool(animator.parameters[i].name).ToString();
                     break;
                 case AnimatorControllerParameterType.Float:
                     new_param.value = animator.GetFloat(animator.parameters[i].name).ToString();
                     break;
                 case AnimatorControllerParameterType.Int:
                     new_param.value = animator.GetInteger(animator.parameters[i].name).ToString();
                     break;
             }
             anim_params.Add(new_param);
         }
     }
 
 [Client]
     void TransmitPlayerAnimations()
     {
         if (isLocalPlayer == true)
         {
             Cmd_RecievePlayerAnimations(anim_params);
         }
     }
 
 [Command]
     void Cmd_RecievePlayerAnimations(List<$$anonymous$$_AnimSync> recieved_anims)
     {
         Rpc_SyncAnimations(recieved_anims);
     }
 
 [ClientRpc]
     void Rpc_SyncAnimations(List<$$anonymous$$_AnimSync> recieved_anims)
     {
         foreach ($$anonymous$$_AnimSync item in recieved_anims)
         {
             switch (item.type)
             {
                 case AnimatorControllerParameterType.Bool:
                     animator.SetBool(item.name, bool.Parse(item.value));
                     break;
                 case AnimatorControllerParameterType.Float:
                     animator.SetFloat(item.name, float.Parse(item.value));
                     break;
                 case AnimatorControllerParameterType.Int:
                     animator.SetInteger(item.name, int.Parse(item.value));
                     break;
             }
         }
     }

$$anonymous$$y only other thought would be to JSON serialize and send to server. Then deserialize on the client and apply the animation parameters.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

213 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

How to predict humanoid retargeting root y offset ? 0 Answers

Why is my Avatar getting unassigned from the Animator at runtime? 1 Answer

Animation not consistent 0 Answers

[network] AddPlayerForConnection for new clients only 0 Answers

animator.crossfade() not working properly 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges