Hello all,
Is there a way to play/stop an animation from/on a specific time?
Below is the script for the animation. On one animation I am doing two different things.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AnimPlay : MonoBehaviour
{
Animation yourAnimation1;
Animation yourAnimation2;
public GameObject go1;
public GameObject go2;
void Awake()
{
yourAnimation1 = go1.GetComponent<Animation>();
yourAnimation2 = go2.GetComponent<Animation>();
}
void Update()
{
if (Input.GetKey(KeyCode.UpArrow))
{
{
yourAnimation1.Play("Elevator Doors");
yourAnimation2.Play("ElevatorInsideDoor");
}
}
}
}