I have the following script on my object:
public class PlayMyCube : MonoBehaviour
{
[SerializeField] private Animator myAnimationController;
private void onTriggerEnter(Collider other) {
if (other.CompareTag("Player")) {
myAnimationController.SetBool("playSpin2", true);
}
}
private void OnTriggerExit(Collider other) {
if (other.CompareTag("Player")) {
myAnimationController.SetBool("playSpin2", false);
}
}
}
When the player character is inside the first cube's trigger, my second cube should play a spinning animation. When they leave, the second cube should stop.
But what happens in the game now is, when the character runs into the trigger, it does nothing.
I have configured my trigger object like this:
I have configured the object that should spin like this:
And configured the Animation Controller like this:
And configured my Player object like this:
What can I do to make this animation play when the player is inside the trigger?





