i have 3 error in my script that i will list bellow with the code:
Assets\scripts\animationStateController.cs(5,14): error CS0101: The namespace ‘’ already contains a definition for ‘animationStateController’
Assets\scripts\animationStateController.cs(12,10): error CS0111: Type ‘animationStateController’ already defines a member called ‘Start’ with the same parameter types
Assets\scripts\animationStateController.cs(20,10): error CS0111: Type ‘animationStateController’ already defines a member called ‘Update’ with the same parameter types
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class animationStateController : MonoBehaviour
{
Animator animator;
int isWalkingHash;
int isRunningHash;
// Start is called before the first frame update
void Start()
{
animator = GetComponent<Animator>();
isWalkingHash = Animator.StringToHash("isWalking");
isRunningHash = Animator.StringToHash("isRunning");
}
// Update is called once per frame
void Update()
{
bool isRunning = animator.GetBool(isRunningHash);
bool isWalking = animator.GetBool(isWalkingHash);
bool forwardPressed = Input.GetKey("w");
bool runPressed = Input.GetKey("left shift");
if (!isWalking && forwardPressed)
{
animator.SetBool(isWalkingHash, true);
}
if (isWalking && !forwardPressed)
{
animator.SetBool(isWalkingHash, false);
}
if (!isrunning && (forwardPressed && runPressed))
{
animator.SetBool(isRunningHash, true);
}
if (isrunning(!forwardPressed || !runPressed))
{
animator.SetBool(isRunningHash, false);
}
}
}
[code]