- Home /
I have two animations, on the same parent object and how do i make them play at different times.
i'm making a sniper and it's set to be bolt action so after every shot the bolt does it's animation. but i also want it to reload at the end but i don't know how because the script i'm using makes both animations play how do i make a script thats plays element 0 when "Fire1" is shot and element 1 at reload?
Answer by PCGamerdude0091 · Jul 27, 2010 at 01:35 AM
Are you using the Unity animator or one from a 3D modeling tool? If the bolt is separate from the gun, you can just rerecord the firing and reloading anims in one go if they're playing one after the other
Answer by AnaRhisT · Jun 23, 2010 at 03:29 PM
animation.wrapMode = WrapMode.Once;
if(Input.GetButton("Fire1")){
animation.CrossFade("shoot");
}
if(Input.GetButton("Fire2")){
animation.CrossFade("reload");
}
after it shot, u can check if the bullets are 0. so
if(bullets == 0 && !animation.isPlaying("reload")){
animation.CrossFade("reload");
}
Your answer
Follow this Question
Related Questions
Can I make animations snap to a frame? 1 Answer
Keep an animation after reload a scene 0 Answers
Animation scripting. 1 Answer
Stop all animations 1 Answer