Noobest Question Ever?

Started by Minigame, November 21, 2012, 09:46:36 PM

Previous topic - Next topic

Minigame

What is the best approach for adding a weapon to a player's hand? Or attaching items such as hats, etc. I've never tried this, and I'm very unsure of where to start. I would need to animate it with the parent model as well.

KittenKoder

If the weapon is only used for the same model, or all the animations for the models using it are the same, you could just animate the model and then parent it, matching the animation of the parent to the weapon. That's the old school method, and it tends to work in most situations. However, if that won't work then you'll have to actually find out where to position the weapon a complex way.

The complex method is to locate the polygon of the model you want the weapon to follow, then using the polygon manager of the object update the weapon to match that polygon's position from the rest of the model, and move the weapon to match. The problem with this method is you have to know the index of the polygon you are going to follow.

If you are using skeletal animations I believe there is a much easier method, but I have no experience with such.
When life throws you lemons, make lemon juice, then drop life into a pile of razors and pour the lemon juice over it.

Minigame

Quote from: KittenKoder on November 21, 2012, 10:13:15 PM
If the weapon is only used for the same model, or all the animations for the models using it are the same, you could just animate the model and then parent it, matching the animation of the parent to the weapon. That's the old school method, and it tends to work in most situations. However, if that won't work then you'll have to actually find out where to position the weapon a complex way.

The complex method is to locate the polygon of the model you want the weapon to follow, then using the polygon manager of the object update the weapon to match that polygon's position from the rest of the model, and move the weapon to match. The problem with this method is you have to know the index of the polygon you are going to follow.

If you are using skeletal animations I believe there is a much easier method, but I have no experience with such.

Thanks for taking the time to reply, the old school method worked perfectly..