as you can tell im new and really trying here for hours but im at a loss-
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayMyAnimation : MonoBehaviour
{
[SerializeField] private Animator myAnimationController;
private void OnTriggerEnter(Collider other)
{
if (other.comparetag("Player"))
{
myAnimationController.SetBool("playbikemove", true);
}
}
private void OnTriggerExit(Collider other)
{
if (other.comparetag("Player"))
{
myAnimationController.SetBool("playbikemove", false);
}
}
}
i want to walk into a box collider and have it trigger the animation, when i walk out it should stop the animation. but its not working at all, i followed a tutorial and it works for others so i dont know.
after adding rigidbody and changing comparetag it seems to be getting closer but i now get this error-
“cannot add component because script class cannot be found. make sure the file name and class match and check for compile errors.”
they do match and everything looks good in visual studio.