Hi, I’m trying to make a simple little platformer and I’m currently building the tutorial level. What I have is when a certain cube collides with a trigger, it plays an animation. The animation is just a simple platform coming down. What I then want to do is after that animation is done, I would check to see if it is done and loop an idle animation. Here is my script (very simple script):
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IfCubeTouches : MonoBehaviour {
public Animator anim;
public GameObject Floor;
public GameObject Cube;
void Start()
{
anim = Floor.GetComponent<Animator>();
}
void OnTriggerEnter(Collider other)
{
if (other.tag == "Cube")
{
anim.Play("FloorGoDownClip");
Destroy(Cube);
}
}
}
After it destroys a cube, I want an if statement to check if the animation, FloorGoDownClip, is done playing. Then I’ll code the rest from there. Thanks in advance!