x


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.

more ▼

asked Oct 23, 2010 at 05:46 PM

sam 1 gravatar image

sam 1
37 21 18 18

that would be an animated cycle.

Oct 23, 2010 at 07:06 PM lampshade
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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.

more ▼

answered Oct 24, 2010 at 01:38 PM

lhk gravatar image

lhk
610 40 29 41

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4866
x636
x134
x13

asked: Oct 23, 2010 at 05:46 PM

Seen: 3015 times

Last Updated: Oct 23, 2010 at 05:46 PM