- Home /
Question by
harry510 · Nov 25, 2014 at 09:51 AM ·
animationsrecoilslingshot
Animation Problem
I've been working on a recoil script for my slingshot, the animation itself works fantastically but when I try to get my script to run it, it does not work. So here is my script attempting to get the animation to work.
// the name of the animation IS Recoil
function Start () {
if (Input.GetMouseButtonDown(0)) {
animation.Play("Recoil");
}
}
All help will be appreciated.
Comment
Answer by NISANTH · Feb 28, 2015 at 03:11 PM
the code must be put in the update function , so that the script can check every update frame for the input of the user .