- Home /
Gun reloading script/instructions?
Hey guys. I making a shooting game with unity 3d, and I want a script or something that makes the gun physically reload.( you know, like take the clip out with your hand, and put in a new one). that sorta thing. So id appreicate iif anyone could give me directions on how to do that. thanks so much guys.
Answer by lhk · Oct 24, 2010 at 01:38 PM
This is done by animations. I assume you have got a model for the weapon and the player or maybe one model for both. Now you need to fire up your modeling program and view some tutorials about animating. For example you could use Blender. A good website is BlenderCookie.org . In case of Blender Unity imports the animations together with the model and you can control them via scripting. Let's assume your gun got an Animation Component with an Animation Clip named "reload" attached to it. Playing the animation is now as simple as
animation.Play("reload");
The scripting part is easy but the animating is difficult.
Your answer
Follow this Question
Related Questions
Make player unable to shoot when reloading 3 Answers
Wrote a script for Shooting, reloading and to display the AMMO in a GUIText 1 Answer
No Reload Script Works 1 Answer
Gun script reload problems 3 Answers
reload help 0 Answers