Here is the error:
Assets\animationStateController.cs(14,34): error CS0117: ‘Animator’ does not contain a definition for ‘StringtoHash’
it doesnt give me the line of the code
Here is my code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class animationStateController : MonoBehaviour
{
Animator animator;
int isWalkingHash;
// Start is called before the first frame update
void Start()
{
animator = GetComponent();
isWalkingHash = Animator.StringtoHash(“isWalking”);
}
// Update is called once per frame
void Update()
{
bool isWalking = animator.GetBool(isWalkingHash);
bool forwardPressed = Input.GetKey(“w”);
// if player presses w key
if (!isWalking && forwardPressed)
{
//then set the isWalking boolean to be true
animator.SetBool(isWalkingHash, true);
}
// if player is not pressing w key
if(isWalking && !forwardPressed)
{
// then set the isWalking boolean to be false
animator.SetBool(isWalkingHash, false);
}
}
}