- Home /
Handgun animation to play once when gun is shot in-game
Okay, so I've made a basic animation... how would I go about linking the animation so that it plays when gun is shot and for it to not loop of course, only to play once upon weapon being used...?
Thank you!
this isn't really an answer, but if you want a pre-made FPS system go to http://www.dastardlybanana.com/FPSConstructorWeapons.htm!
Answer by Michael 12 · May 11, 2011 at 07:59 PM
You would have to mod it but this works well for my shotgun reload:
function Reload () {
// Wait for reload time first - then add more bullets!
yield WaitForSeconds(1);
gunAnimation.Play("Reload");
audio.PlayOneShot (reloadSound);
yield WaitForSeconds(reloadTime);
// We have a clip left reload
if (shells > 0) {
shells--;
shellsLeft = shells;
}
}
Yur very welcome. $$anonymous$$ight have to set a few things on your animation in the inspector but I think the defaults should be fine ;)
Your answer
Follow this Question
Related Questions
FPS animations for different purposes? 1 Answer
Switch Weapon Script Not taking effect HELP!! 2 Answers
Select Object ( Weapon ) Quick! Help! xD 1 Answer
FPS Aim Down Sights. Exact Position. 1 Answer
animating multiple weapons with 2 arms 0 Answers