Search Unity

Need help on: swappaing equipment on units in game (rigging)

Discussion in 'Getting Started' started by Flaboere, Jun 8, 2015.

  1. Flaboere

    Flaboere

    Joined:
    Jun 5, 2014
    Posts:
    5
    Hey
    I'm starting a mobile game, where the player commands 5-10 units in a level; the player will be able to change the gear/equipment for his units (individually) such as bags, helmets, weapons etc. Exactly the way it works fx Dota 2 or Team Fortress 2.

    What I'm wondering is how I go about rigging the 3D models. I have a base model (the soldier) and I have the gear; do I rig everything in Maya and import it, then turn on/off bits of the mesh? Do I import the base as 1 model, then seperately import gear bits on their own? If so, what should I look out for to make them work in Unity, so they fit the base model and move correctly? Do I just make fx the helmet a child of the base model, no rigging needed?
     
  2. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    This will probably depend on how often you plan on changing equipment, and how close to the units you will be.
    Often characters have a main skin mesh with separate standard meshes for things like eyes, helmets, weapons etc.
    Sometimes these are all merged into one mesh for performance.

    You won't need eyes to be separate if you are far away from them.
    If you change equipment often it might be best just to keep them as separate pieces and budget for that.

    So as with many of these things, the answer is 'it depends' :)
     
  3. Reahreic

    Reahreic

    Joined:
    Mar 23, 2011
    Posts:
    254
    When I've had to switch hand held items on a regular basis i'd create an empty game object parented and positioned at the appropriate location, (usually the palm) and then use that to bind the applicable object to the users hand. The same could be done for say helmets and backpacks depending on the fidelity and amount of animation required.
     
  4. Flaboere

    Flaboere

    Joined:
    Jun 5, 2014
    Posts:
    5
    Thanks for your replies, really helpful! @3agle the characters won't be very big, and I don't plan to have their eyes move in game. Gear will be something the player can change between missions, and will mostly be for looks to make his characters a bit more unique looking. I don't expect it's something that will be changed between every mission. We're gonna sell gear that they can equip, so it's in that tune.

    @Reahre that sounds like the aproach I should use; when you make the gear in, say, Maya, do you then position and rotate it so that it fits the character before exporting it? Or do you just do all that in Unity?
     
  5. 3agle

    3agle

    Joined:
    Jul 9, 2012
    Posts:
    508
    Yeah so making them as separate objects probably with a pivot at (0,0,0) is probably a good approach, then you can just instantiate the objects and parent them to the relevant bone (hand, head etc).

    That should work for most cases, though if you need equipment that bends with the character (armour, harnesses etc), you have a couple of choices.
    You could animate the items as separate objects, but so that they still fit with the characters animations, this would be better for memory but could be difficult to co-ordinate animations (though not super difficult).
    Or you could have these as parts of the characters FBX and animate both, then just show or hide the bits you want. That's certainly not an ideal method in terms of performance but would be easiest.

    There may be other ways but I can't think of any right now, hope that helps.
     
  6. Flaboere

    Flaboere

    Joined:
    Jun 5, 2014
    Posts:
    5
    Thank you very much for the helpful replies.