Hi, I want to attach a weapon (axe, sword that sorta thing) to the hand of my character. What would you guys say is the best option?
- animating the weapon with the model and then seperating it (rather not 'cos this is more work, specially if I want to have more than one weapon)
- just attaching it and making sure it rotates with the hand (preferable, but only if it's gonna work properly)
The first option is my prefered option b/c its easier codewise. All you have to do in that instance is to code it to follow the player. It's origin has already been set in MED to be in the hand of the model when the two are put together.
Well if nobody has a convincing argument against animating weapons with the models, I guess that's what I'll be doing.
Posted By: EpsiloN
Re: Attaching a weapon - 07/28/06 16:13
but its easyer to place a weapon on the hand at a certain vertex and point it to the direction between 2 vertices (on the hand)
..."convincing argument against animating weapons with the models"...I have one...if you have 2000 weapons in the game,what would you do?

definitely wont animate them all.
Posted By: Filipe
Re: Attaching a weapon - 07/28/06 17:02
one solution i found was to use a bone on the player hand. it's better than attaching it to a vertex because the bone also has direction, so you just set the weapon to the bone's position and direction. another good point is that you can get the bone by name, and not a number, so if you have more than one model that can be holding the weapon, you don't need to get the vertex number for each model, you just need that all of them have a bone with the same name...
Now that sounds like an intersting idea. What bone would it be though- the bone at the start of the fingers?
Posted By: Filipe
Re: Attaching a weapon - 07/28/06 17:36
yes, if you have a bone for the character hand, you could make another one called 'weapon' from the hand bone,and attach the weapon to that bone...
Posted By: Alberto
Re: Attaching a weapon - 07/28/06 17:58
I tried both vertex method , by the way see also AUM, and bone method to attach a weapon
The latter is better, in my opinion
Posted By: Anonymous
Re: Attaching a weapon - 07/29/06 10:07
Quote:
What bone would it be though- the bone at the start of the fingers?
Just make a new bone in the palm or something.
I like the vertex option because it just allows me to make a weapon model and be done with it. I'm working on a game that has a lot of different weapons and characters, and in the middle of a battle, I want characters to be able to pick up a weapon that's just lying around. So creating animations for each weapon for each character is pretty extreme.
Posted By: lostclimate
Re: Attaching a weapon - 07/30/06 02:57
go to acknex resourses unlimited, and go to wdls/dlls, download vattach, it works perfect, i used it with the guns in my game
Posted By: lostclimate
Re: Attaching a weapon - 08/06/06 22:50
just replace gun with the object and the numbers in the addons line represent the vertexs, first being the origin of the weapon, the second is the direction it is pointing, and the third is the were the roll direction will point
if(gun!=null)
{
you = me; //YOU==the object we are sticking things to eg. the player
temp = handle(gun); //handle of our item to attach eg. a weapon
addons(temp,747,748,749);
}
Posted By: yokan
Re: Attaching a weapon - 11/11/06 05:15
i have a question, that script must be in the "weapon action", or in the "player action"?
thank you.. =D