Author Topic: Noobest Question Ever?  (Read 2343 times)

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Noobest Question Ever?
« on: November 21, 2012, 09:46:36 pm »
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.

Offline KittenKoder

  • int
  • **
  • Posts: 66
  • I Am No One Else
    • View Profile
    • Kitt Games Wiki
Re: Noobest Question Ever?
« Reply #1 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.
When life throws you lemons, make lemon juice, then drop life into a pile of razors and pour the lemon juice over it.

Offline Minigame

  • int
  • **
  • Posts: 55
    • View Profile
Re: Noobest Question Ever?
« Reply #2 on: November 29, 2012, 10:51:01 am »
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..