- Home /
Question by
SuperCrusher22 · Sep 23, 2021 at 02:12 AM ·
animatoranimator controlleranimationsnot workingplaying
Animations Won't Play
So, I am using this script to try and make an animation play on specific triggers. The triggers and colliders work. (I have done Debug.Log to ensure that they work.) But the animations will not play at all. I have double checked everything and still had no luck. This is my script: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PhysBall : MonoBehaviour
{
public Animation Ball;
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("jumpPad"))
{
Ball.Play("BallJumping");
}
}
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Ground"))
{
Ball.Play("FallingBall");
}
}
}
Comment
Just in case, are the animations marked as legacy? (https://docs.unity3d.com/ScriptReference/Animation.Play.html)
I don't believe so. I have checked to make sure and saw nothing saying what type of animation it was.