Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

Parameter Hash does not exist | Stealth Tutorial > Sliding Doors

Discussion in 'Animation' started by SyedUsman, Mar 22, 2015.

  1. SyedUsman

    SyedUsman

    Joined:
    Mar 22, 2015
    Posts:
    1
    am making sliding doors in unity Steal Tutorial project and using the HashIDs script to reference stuff.

    Getting this error :

    Parameter "Hash 71445658" does not exist.

    Well i see the HashIDs script and the parameter does exist.

    Im a noob, please guide me.

    Here is the code for Door Animation Script:
    Code (CSharp):
    1.  
    2. usingUnityEngine;usingSystem.Collections;
    3.  
    4. publicclassDoorAnimation:MonoBehaviour{publicbool requireKey;publicAudioClip doorSwishClip;publicAudioClip accessDeniedClip;
    5.  
    6. privateAnimator anim;privateDoneHashIDs hash;privateGameObject player;privatePlayerInventory playerInventory;privateint count;
    7.  
    8.  
    9.  
    10.  
    11. voidAwake(){
    12. anim =GetComponent<Animator>();
    13. hash =GameObject.FindGameObjectWithTag(Tags.gameController).GetComponent<DoneHashIDs>();
    14. player =GameObject.FindGameObjectWithTag(Tags.player);
    15. playerInventory = player.GetComponent<PlayerInventory>();
    16.  
    17. }
    18.  
    19.  
    20. voidOnTriggerEnter(Collider other){if(other.gameObject == player){if(requireKey){if(playerInventory.hasKey){
    21. count++;}else{
    22. audio.clip = accessDeniedClip;
    23. audio.Play();}}else{
    24. count++;}}
    25.  
    26. elseif(other.gameObject.tag ==Tags.Enemy){if(other isCapsuleCollider){
    27. count++;}}}
    28.  
    29. voidOnTriggerExit(Collider other){
    30.  
    31. if(other.gameObject == player ||(other.gameObject.tag ==Tags.Enemy&& other isCapsuleCollider)){
    32. count =Mathf.Max(0, count-1);}
    33.  
    34. }
    35.  
    36.  
    37. voidUpdate(){
    38. anim.SetBool(hash.openBool, count >0);
    39.  
    40. if(anim.IsInTransition(0)&&!audio.isPlaying){
    41. audio.clip = doorSwishClip;
    42. audio.Play();
    43.  
    44.  
    45. }}


    and this is the Hash IDs script :
    Code (CSharp):
    1. using UnityEngine;
    2.         using System.Collections;
    3.  
    4.         public class HashIDs : MonoBehaviour
    5.         {
    6.             // Here we store the hash tags for various strings used in our animators.
    7.             public int dyingState;
    8.             public int locomotionState;
    9.             public int shoutState;
    10.             public int deadBool;
    11.             public int speedFloat;
    12.             public int sneakingBool;
    13.             public int shoutingBool;
    14.             public int playerInSightBool;
    15.             public int shotFloat;
    16.             public int aimWeightFloat;
    17.             public int angularSpeedFloat;
    18.             public int openBool;
    19.            
    20.            
    21.             void Awake ()
    22.             {
    23.                 dyingState = Animator.StringToHash("Base Layer.Dying");
    24.                 locomotionState = Animator.StringToHash("Base Layer.Locomotion");
    25.                 shoutState = Animator.StringToHash("Shouting.Shout");
    26.                 deadBool = Animator.StringToHash("Dead");
    27.                 speedFloat = Animator.StringToHash("Speed");
    28.                 sneakingBool = Animator.StringToHash("Sneaking");
    29.                 shoutingBool = Animator.StringToHash("Shouting");
    30.                 playerInSightBool = Animator.StringToHash("PlayerInSight");
    31.                 shotFloat = Animator.StringToHash("Shot");
    32.                 aimWeightFloat = Animator.StringToHash("AimWeight");
    33.                 angularSpeedFloat = Animator.StringToHash("AngularSpeed");
    34.                 //openBool = Animator.StringToHash("Open");
    35.                 openBool = Animator.StringToHash("open");
    36.             }
    37.         }


    any help will be greatly appreciated :)
     
  2. technarchy

    technarchy

    Joined:
    Apr 23, 2015
    Posts:
    1
    I had the same error myself, also the doors would not open for the player.

    My hashID script
    openBool = Animator.StringToHash("Open");
    but my bool in the animator controller was "open" with a lower case O
    once both matched the doors work and no more error - Parameter "Hash 71445658" does not exist.

    hope this is a help
     
    stephenmurya likes this.
  3. stephenmurya

    stephenmurya

    Joined:
    Aug 5, 2022
    Posts:
    2
    It might be a typo. Maybe you typed Velocity z, but it was actually Velocity Z.

    This is for anyone who might be having this issue. It really frustrated me. I don't want that for anyone
     
  4. calmbug

    calmbug

    Joined:
    Oct 15, 2018
    Posts:
    1
    It might be a different Animator Controller. For example, I have a NPC prefab then someday test purpose or whatever the reason I changed that something a different Animator Controller. It's silly, but It happens to any of us i guess. That brought me here.
     
    Last edited: Jan 20, 2023