Search Unity

Method not found: 'UnityEngine.AnimatorControllerParameter.set_name'

Discussion in 'Scripting' started by RakNet, Sep 24, 2017.

  1. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    This shows up in the log in build mode, but doesn't happen when I run from the editor

    That same message fills up the log

    This is the code:

    Code (CSharp):
    1. public static class AvatarAnimatorControllerParameters
    2.     {
    3.         static public readonly UnityEngine.AnimatorControllerParameter Property_TotalSpeedPercentile = new UnityEngine.AnimatorControllerParameter();
    4.         static public readonly UnityEngine.AnimatorControllerParameter Property_ForwardBackSpeedPercentile = new UnityEngine.AnimatorControllerParameter();
    5.         static public readonly UnityEngine.AnimatorControllerParameter Property_RightLeftSpeedPercentile = new UnityEngine.AnimatorControllerParameter();
    6.         static public readonly UnityEngine.AnimatorControllerParameter[] allParameters;
    7.  
    8.         static AvatarAnimatorControllerParameters()
    9.         {
    10.             Property_TotalSpeedPercentile.name = "Property_TotalSpeedPercentile";
    11.             Property_TotalSpeedPercentile.type = UnityEngine.AnimatorControllerParameterType.Float;
    12.  
    13.             Property_ForwardBackSpeedPercentile.name = "Property_ForwardBackSpeedPercentile";
    14.             Property_ForwardBackSpeedPercentile.type = UnityEngine.AnimatorControllerParameterType.Float;
    15.  
    16.             Property_RightLeftSpeedPercentile.name = "Property_RightLeftSpeedPercentile";
    17.             Property_RightLeftSpeedPercentile.type = UnityEngine.AnimatorControllerParameterType.Float;
    18.  
    19.             allParameters = new UnityEngine.AnimatorControllerParameter[] { Property_TotalSpeedPercentile, Property_ForwardBackSpeedPercentile, Property_RightLeftSpeedPercentile };
    20.         }
    21.     }
    22.  
     
  2. RakNet

    RakNet

    Joined:
    Oct 9, 2013
    Posts:
    315
    If I create the AnimatorControllerParameter at runtime I get this instead:
    MissingMethodException: Method not found: 'UnityEngine.AnimatorControllerParameter.set_name'.
    at BaseMod.V1.AvatarMovementEffects.Update () [0x00000] in <filename unknown>:0

    Code (CSharp):
    1. static public UnityEngine.AnimatorControllerParameter Property_TotalSpeedPercentile()
    2.         {
    3.             UnityEngine.AnimatorControllerParameter acp = new UnityEngine.AnimatorControllerParameter();
    4.             acp.name = "Property_TotalSpeedPercentile";
    5.             acp.type = UnityEngine.AnimatorControllerParameterType.Float;
    6.             return acp;
    7.         }