- Home /
Question by
jimmyismike · Jun 12, 2011 at 05:34 PM ·
animationtriggerreload
Trigger Animation Button
How can i trigger a animation with a button. The animation is called reload and the button i wanna trigger it with is r
Comment
Best Answer
Answer by Meater6 · Jun 12, 2011 at 07:20 PM
Try this:
function Update () {
if(Input.GetKeyDown("R")) {
animation.Play("animationName");
}
}
NOTE: this script is untested. By the way, please do not ask for complete scripts, but ask for specific questions on how to script this.
Your answer
![](https://koobas.hobune.stream/wayback/20220612103610im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity animation offset only in game? 0 Answers
Animation trigger button 2 Answers
trigger animation problems 2 Answers
Triggering a basic animation via Box Collider 4 Answers
Light animation and Main Menu animation at same time from 1 trigger 0 Answers