Search Unity

Animator, Parameter does not exists bugg?

Discussion in 'Editor & General Support' started by Eqric, Jan 28, 2013.

  1. bhavi1

    bhavi1

    Joined:
    Oct 19, 2013
    Posts:
    4
    same bug in 5.3
     
    MrEsquire likes this.
  2. Deadelven

    Deadelven

    Joined:
    Jan 26, 2016
    Posts:
    1
    Hey guys Hope this thread isn't Zombied. I found a solution that works for me.
    Instantiate your prefab with the animator and network animator Disabled. and then add a script that Enables those scripts in the start.

    using UnityEngine;
    using System.Collections;
    using UnityEngine.Networking;

    public class StartAnimator : NetworkBehaviour {

    [SerializeField] Animator Zomanimator;
    [SerializeField] NetworkAnimator ZomNetworkAnimator;

    // Use this for initialization
    void Start () {
    Zomanimator.enabled = true;
    ZomNetworkAnimator.enabled = true;
    }

    // Update is called once per frame
    void Update () {

    }
    }
     
  3. Psychonerd

    Psychonerd

    Joined:
    Jan 25, 2013
    Posts:
    3
    Nothing worked for me. I ended up using boolean
     
  4. jakejolli

    jakejolli

    Joined:
    Mar 22, 2014
    Posts:
    52
    I've got this bug as well. Running Unity 4.7 something (newest 4.x release as of posting).

    It's definitely a bug. Some calls to SetInteger("integerName", int) cause the warning, others don't. Even with the warning, the integer is being set correctly... very strange.

    Not a real issue for me, just a bit disconcerting to see warnings for seemingly no reason...

    How can I submit a bug report? I'll also provide my project.
     
  5. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    Well pointless to submit bug report on version 4.7 as they do not support it anymore.
    If we still see this issue on the latest version 5.3.2 then definitly should post a bug report with the bug report tool in the help menu of Unity.
     
  6. aldensnow

    aldensnow

    Joined:
    Feb 8, 2016
    Posts:
    1
    I didn't see the Animator Parameter window at first, once I put my parameter name in there things worked better for me.
     
  7. rad1c

    rad1c

    Joined:
    Feb 26, 2016
    Posts:
    21
    same issue here (April, 2016... original post is from 2012), save, close animator tab, restart sorts out until it pops up again (so has to do the same again, and again, and again...)
     
  8. jeremyplayraven

    jeremyplayraven

    Joined:
    Aug 21, 2015
    Posts:
    6
    This just started happening to me in 5.3.4f1 after an artist added a new Animator component to an object in the scene. If I can isolate it I'll open a new bug, but currently it would be a 5GB upload which I don't have time for.

    1) Recompile any script.
    2) This message appears twice (selecting the message in the console highlights the GameObject with the new Animator component):
    Code (CSharp):
    1. Parameter '' does not exist.
    2. UnityEditor.DockArea:OnGUI()
    3) Scripts finish compiling (regular code warnings appear in the console)
    4) This message appears twice, again for the same GameObject as before:
    Code (CSharp):
    1. Parameter '' does not exist.
    2. UnityEngine.UI.Selectable:OnValidate()
    5) Then this message appears twice (same GameObject):
    Code (CSharp):
    1. Parameter '' does not exist.
    2. UnityEngine.CanvasRenderer:RequestRefresh()
    6) And finally, this message twice:
    Code (CSharp):
    1. Parameter '' does not exist.
    2. UnityEditor.HostView:OnGUI()
     
  9. jeremyplayraven

    jeremyplayraven

    Joined:
    Aug 21, 2015
    Posts:
    6
    It also appears that if I have the Animator / Animator Parameter windows open, instead of the above side effects I get this message 5 times instead (in edit mode):
    Code (CSharp):
    1. Animator has not been initialized.
    2. UnityEngine.CanvasRenderer:RequestRefresh()
    And then if I play the scene, I get this message 5 times:
    Code (CSharp):
    1. Parameter '' does not exist.
    2. UnityEngine.UI.Selectable:OnValidate()
     
  10. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    130
    For those having the same issue, do the following things:
    1. Check if the parameter name in C# script matches the one in the Animator Controller.
    2. Check if the Animator Controller is added to the character.
    3. Check if the C# script is added to the character.
    4. Close Animator Tab, and restart Unity.
    5. Remove those parameters in the Animator Controller, and add other type of parameter in it (if you were using float, then use integer instead). Now in the C# script, change the SetFloat function to SetInteger to match the Animator Controller we just changed. Run the project to see if warnings show up again the in the console. In my case, the "parameter doesn't exist" warning didn't show up anymore. So I change the parameters back to float type, and change the C# script back to original one. Finally, my problem resolved.
    I'm not sure what the problem is, but you can check these steps to see if your problem gets solved, too.
     
  11. Bezzy

    Bezzy

    Joined:
    Apr 1, 2009
    Posts:
    75
    [Edit: False Alarm! Figured it out. To control our layers' weight from animation curves, we add a parameter with the same name as the layer, check if that parameter is being controlled, and if it is, we set the weight of the layer to that curve value. And yes, it means that we're kind of a frame behind with the layer weights, but we can always call "animator.Update(0)" to refresh. Probably not good for stuff that's animated en masse, but this is a one off in our game.

    Anyway, yeah, i forgot to add a parameter with the same name]


    Just appeared in 5.5.0f3 for me after an upgrade.
    Code was previously working.
    I cached off hashes of each layer into a list, during Awake(), using _anim.layerCount to iterate through all the animator's layers, and _anim.GetLayerName(i) to get the name of the layer.

    When the hashed values are used used in Update(), only the last layer seemed to throw up the warning.

    I tried putting the caching in Start() instead of Awake() because I've sometimes had trouble with affecting the animator as early as Awake(). But it didn't make any difference.

    The particular call that caused the error is Animator's "IsParameterControlledByCurve( hashValue )"
     
    Last edited: Dec 7, 2016
  12. xxchkzgames

    xxchkzgames

    Joined:
    Dec 18, 2016
    Posts:
    1
    if you are coding like: public Animator anim; and then anim = findobjecoftype<Animator>();
    replace anim.set bool/trigger etc to getcomponent<animator>().bool/trigger ect
    :)
     
  13. tmendez

    tmendez

    Joined:
    Oct 12, 2015
    Posts:
    35
    Had the same problem, just had to add the variable name (in my case, "Normal") to the Animator's parameters as a trigger.

     
  14. Isazero

    Isazero

    Joined:
    Jun 16, 2017
    Posts:
    1
    Same problem. Version 5.6.1f . Literally, tried everything from above. I don't what to do. This is error "
    Parameter 'State' does not exist.
    UnityEngine.Animator:SetInteger(String, Int32)
    Character:set_State(CharState) (at Assets/Scripts/Character.cs:18)
    Character:CheckGrounded() (at Assets/Scripts/Character.cs:84)
    Character:FixedUpdate() (at Assets/Scripts/Character.cs:36)"

    And here is my code "
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class Character : MonoBehaviour {
    [SerializeField]
    private int lives = 5;
    [SerializeField]
    private float speed = 3.0F;
    [SerializeField]
    private float jumpForce = 15.0F;

    private bool isGrounded = false;

    private CharState State
    {
    get {return (CharState)GetComponent<Animator>().GetInteger("State"); }
    set { GetComponent<Animator>().SetInteger("State", (int) value); }
    }

    new private Rigidbody2D rigidbody;
    private Animator animator;
    private SpriteRenderer sprite;


    private void Awake()
    {
    rigidbody = GetComponent<Rigidbody2D>();
    animator = GetComponent<Animator>();
    sprite = GetComponentInChildren<SpriteRenderer>();

    }

    private void FixedUpdate()
    {
    CheckGrounded();
    }

    private void Update()
    {
    if (isGrounded)
    {
    State = CharState.Idle;
    }

    if (Input.GetButton("Horizontal"))
    {
    Run();
    }

    if (isGrounded && Input.GetButtonDown("Jump"))
    {
    Jump();
    }
    }

    private void Run()
    {
    Vector3 direction = transform.right * Input.GetAxis("Horizontal");

    transform.position = Vector3.MoveTowards(transform.position, transform.position + direction, speed * Time.deltaTime);

    sprite.flipX = direction.x < 0.0F;

    if (isGrounded)
    {
    State = CharState.Run;
    }
    }

    private void Jump()
    {
    rigidbody.AddForce(transform.up* jumpForce,ForceMode2D.Impulse);
    }

    private void CheckGrounded()
    {
    Collider2D[] colliders = Physics2D.OverlapCircleAll(transform.position, 0.8F);

    isGrounded = colliders.Length > 1;

    if (!isGrounded)
    {
    State = CharState.Jump;
    }
    }
    }

    public enum CharState
    {
    Idle,
    Run,
    Jump
    }"

    If somebody can help me I would be so much grateful
     
  15. Eggtooth

    Eggtooth

    Joined:
    Dec 29, 2015
    Posts:
    2
    Same error. I think I will just stop using unity. I was considering upgrading to pro but this engine is so buggy and unfinished, that I think Unreal will be better, even though porting everything will take time.
     
  16. postilgadima

    postilgadima

    Joined:
    Sep 26, 2017
    Posts:
    1
    Is still actual in Unity 2017.1.1f1


    Animator has bool parameter "isHidden" .
    C# script call :

    bool isHidden = contentPanel.GetBool("isHidden");

    Result in console:
    Parameter 'isHidden' does not exist.

    I found a solution, because it was my fault. It is not my fist "isHidden" parameter in the game and I'm very lazy , so i always did copy-past of "isHidden" and after that I set it to the new animator.

    In the result I had "isHidden " in the animator. "isHidden " and "isHidden" . It is different parameters but in Unity it is unpossible find current mistake if you don't know about it

    Dear Unity's developers team, Could you split name of parameters by SPACE before and after full words? It will be awasome.
     
  17. redagrandrei

    redagrandrei

    Joined:
    Sep 3, 2017
    Posts:
    37
    Happens on version 2017
     
  18. LeRan

    LeRan

    Joined:
    Nov 24, 2015
    Posts:
    114
    Confirmed, bug still there. The animator fails to identify miscellaneous parameters ("Parameter XXX does not exist") which vary over the course of the execution : some time parameter A is missing, other times in the same loop parameter A exists but parameter B does not, sometimes both exist or both don't... I failed to identify the logic behind that. For me it's always "integer" of "float" parameters that go missing, I never saw it happening to booleans.

    It seems that trouble started when I added a "trigger" parameter. Now I deleted it, closed the tabs, restarted Unity, build anew... nothing works, it seems to be definitely buggy.

    Nota: I don't want to file a bug report, because my project is rather huge now and I don't want to spend days or weeks epuring eveything until I sort out the bug in a standalone executable.

    P.S. or erratum : I'm not even sure of what I just wrote. Further testing makes everything even more blurred. In a few occasions it said that one parameter did not existe while setting and displaying its correct value. And now I can't even reproduce this behaviour. I'd better go for a walk.
     
    Last edited: Dec 3, 2017
    sahilsrivastava and MrEsquire like this.
  19. sahilsrivastava

    sahilsrivastava

    Joined:
    Jan 18, 2018
    Posts:
    9
    The bug is still here apparently...in 2018
     
  20. Ashkaari

    Ashkaari

    Joined:
    Feb 22, 2016
    Posts:
    1
    So sad that I encounter this bug too,using Unity 2017.04 Version, and it's 2018.05.09. Five years has past this bug still exists.
     
    Last edited: May 9, 2018
  21. pierrepaul

    pierrepaul

    Unity Technologies

    Joined:
    Jun 19, 2012
    Posts:
    162
    Hi.

    The message might popup when a script is reloading - ie during a domain reload. Its a know issue but it should not affect gameplay at all. Otherwise we often see a " " problem. Ie a space before/after the parameter name.

    If its something else, please file a bug with repro. I cannot find any bug in our database that matches what is described here. And I personnaly have never experienced this bug.
     
  22. Hirni

    Hirni

    Joined:
    Jul 12, 2018
    Posts:
    1
    I got the same problem (2018.1.7f1). This is not a space-issue. For me it's a boolean parameter which I cannot set.
    Neither switching the Animator tab off and restarting Unity nor rewriting the code to get the Animator directly works for me.
     
  23. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    707
    Open the animator controller in a text editor (ensuring that your assets are serialized as text) and check the name of the parameter as serialized by Unity. That should reveal what is going on.
     
  24. maxinetoto

    maxinetoto

    Joined:
    Apr 4, 2018
    Posts:
    1
    I just got this error in 2018.1.6f1. Firstly, my code was working fine yesterday. I read through all the posts here and tried everything. I have the parameters window open and I can literally SEE the parameters. There are three. When I debug the animator object, I get that "Animator Parameter Count: 1" and "Parameter 0 is UnityEngine.AnimatorControllerParameter"

    Edit: It now works again after I renamed everything. Really don't think it's a typo since the problem is only intermittent.
     
    Last edited: Aug 3, 2018
  25. cjcatrix

    cjcatrix

    Joined:
    Jun 8, 2014
    Posts:
    13
    Just a note I thought I had this problem too - was a case typo in my case, On vs on. Not discounting other's experiences - just suggesting another thing to check.
     
  26. OldLegWig

    OldLegWig

    Joined:
    Mar 18, 2018
    Posts:
    81
    I experienced the same bug. Closing the animator window and restarting made it go away.

    2018.3.0f2
     
  27. Thomas-Bousquet

    Thomas-Bousquet

    Joined:
    Dec 19, 2016
    Posts:
    3
    Similar problem in 2018.3.7f1 Personal. I have a custom editor that parses the animator parameters to put them in a Pop menu and
    Code (CSharp):
    1. //where anim is an Animator
    2. foreach (AnimatorControllerParameter param in anim.parameters)
    3. {
    4. //...
    5. }
    doesn't loop; the size of anim.parameters being 0.

    No script is compiling, there are no errors or warning in the log.
    The animator window shows the proper parameters; I can change their value..

    It 'seems' to be happening after making some code changes; but it isn't a consistent repro.
     
  28. rgeeinstead

    rgeeinstead

    Joined:
    Dec 5, 2018
    Posts:
    1
    Still experiencing the bug.2018.2.18 version. Tried shutting down the animator and inactivating the animator for each effected object and restarting but this did not fix it. All was running fine yesterday but the bug started inexplicably today. Also tried removing all triggers, booleans, in the animator and recreating. Still get the error. Tried removing conditions on transitions and recreating with the new parameters, and still get the error. Double checked syntax in code and all is good.
    Getting frustrated here.
     
  29. straightuptech

    straightuptech

    Joined:
    Jan 26, 2019
    Posts:
    2
    I am Having the same problem with the Bug. If I delete the states and parameters and again make the animation it starts for the current session but as soon as I close unity and start it again all the trigger animation freezes only the animations in Update function are working. Please help..
     
  30. tinho1990

    tinho1990

    Joined:
    Jul 17, 2019
    Posts:
    3
    Same bug
    2019.1.10f1
     
unityunity