Question by
unity_Anjt0b7JlcajdQ · Oct 10, 2018 at 11:39 PM ·
animationtriggermodelclip
Play Animation on key pressed
I am using someone elses scifi-robot model, and i dont know how to access the animation clips,
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class PlayAnim : MonoBehaviour
{
public Animation Boi;
public KeyCode MyKey;
public string MyTrigger;
void Update()
{
if (Input.GetKey(MyKey))
{
GetComponent<Animator>().SetTrigger();
}
}
}
i got this of of online, so i dont know what Trigger" is at all.
Comment
Your answer
Follow this Question
Related Questions
Animation Trigger (Rpg Kit) 1 Answer
ANIMATION STRANGELY DOES NOT PLAY 0 Answers
How do I detect single hit on single attack? 1 Answer
Why isn't my blender character not working properly? 1 Answer
How can I play two animations for two different gameobjects at the same time with one trigger. 1 Answer