Quantcast
Channel: Questions in topic: "error"
Viewing all articles
Browse latest Browse all 7934

An instance of type 'UnityEngine.Animator' is required to access non static member 'GetBool'

$
0
0
I'm working on a FPS. I'm new in Unity so I don't know much about scripting. I want to make a script that makes the player able to enter aiming mode. This is the script: @script RequireComponent(Animator) function Update () { if (Input.GetButtonDown ("Fire2")) { if (!Animator.GetBool("aimingMode")) { Animator.SetBool("aimingMode", true); aimingMode = true; } } } I know it's unfinished. The problem is that when I take a look at the console in unity, it says: An instance of type 'UnityEngine.Animator' is required to access non static member 'GetBool'. I don't know how to solve this. The gameobject has already got an animator with an animation controller and the booleans set. Please help.

Viewing all articles
Browse latest Browse all 7934

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>