Sockets are like slots on your model that are hardcoded into the engine to represent certain aspects of the game. You can add to these of course in Unrealscript, but we will be sticking to the 16 needed in order to get your character working.
An example is telling the engine where the gun is to go on your model. We know it goes where the Bone_Weapon is, the engine does not. So lets give it an education in 'Dude, Where's my gun 101'.
Open up the Attach Rollout in the Mesh Tab in the Animation Browser.
Open the Sockets rollout, it won't have any by default and that's good. A clean slate for you to mess up :) Click on the Sockets slot and press Add. A new socket will come up, make sure it is expanded so you can edit the following slots to the following in blue.
AttachAlias righthand
BoneName Bone_Weapon
THe other options are as they imply. You can move the socket and rotate it's pivot in the engine so as to tweak the information within the engine. This way you can have one bone with many sockets, although each socket can have different placement and rotation refereing to the bone for movement.
This comes in handy if a pivot is wrong in your model, or you want multiple attachments to a bone without having to make multiple boones in the first place etc. There are many uses.
Also note you must set the ApplyNewSockets slot to TRUE each and every time you want to apply a change to the socket information. If you forget to do this something you did still may not count and you'll get frustrated and call me up in the middle of the night complaining I taught you everything wrong and your world is falling apart and you have 5 kids to feed and a mortgage to pay and a dog that needs vaccinating, and...
By the way....don't do the latter...
In this case we have just designated the bone Bone_Weapon in our mesh as the weapon socket. the righthand AttachAlias is hardcoded into the engine as the one to hold the gun. You could hawever make any bone in your mesh assigned to the righthand AttachAlias if you so wanted. We could now go and test our character in game to find that a) he is holding the gun and b) it is facing the wrong way! (dammit!)
I can a) fix this by editing the pivot in MAX and reexporting the mesh or b) rotate and move the gun's socket information in the engine. I'm going to do that to show you just how cool it is. Cos it is you know...cool. Like ice even. Which is, in fact, quite cold. |