|
Title: Suggestions for dealing with modular characters in Unity? Post by: Tony Coculuzzi on May 05, 2013, 07:24:38 AM Hey guys. In a game I'm working on, I'm looking to allow the player to equip different pieces of equipment. Does anyone know of the best way to go about doing this? I'm looking for any reading material on the subject, just so I can make the system as clean and functional as possible.
The way I'm thinking about going about it is having a base rig, and every equipment piece will be a model weighted to that rig as a different game object. The thing is, every weapon will have a different torso walk animation, but the legs will animate the same way. For example, walking with a two handed sword will be different than walking with dual pistols. On top of that, the player will be able to attack while walking, so they legs will still need the walking animation, while the torso plays the attacking animation. All of this, while still taking into account that these pieces will be interchangeable (with equipment) Anyone know the best way I can achieve this? All suggestions welcome. Title: Re: Suggestions for dealing with modular characters in Unity? Post by: Gimym JIMBERT on May 07, 2013, 09:46:01 AM Well depend on how well covered the character is by the character.
You don't necessarily need fancy weight for weapon, just parenting to a gizmo is enough. So you animate as usual using a non exportable generic objects, then add a gizmo later with the correct offset for each subclass of the weapon. Animation is obviously blended or animated depending on case. Not a problem with the legacy animation system, even less with mecanim. For part that cover the character part entirely, it's best to have a segmented character skin you can swap in and out. For example cloth. And off course optimize with a mesh blender to reduce draw calls, that mean using the same material for all object that compose a character (it should not be a problem but beware of the 64k vertex limit). There is a skin mesh blender on the unify for the skinned part. Title: Re: Suggestions for dealing with modular characters in Unity? Post by: Tony Coculuzzi on May 08, 2013, 04:18:24 PM You seem to be pretty helpful around here haha, so thanks!
I've been thinking about that. Right now, we have a system set up with each piece being a separate mesh, all weighted to the same rig. The mesh blending is something I overlooked though, is this (http://wiki.unity3d.com/index.php/MeshMerger) the script you're talking about? The thing I'm least sure of is dealing with the different upper-body walk cycles. These are different for every weapon type, but the leg movement will always stay the same. I'm thinking about having the upper-body animations done separately, and having a full walk cycle (upper and lower body) play on an animation layer of lower priority than the upper-only animation. If I did it this way, would the higher-priority animation layer take precedence over the other? If that's the case, I'll be using that with the attack animations as well, as they will also be playing while the character is walking. Title: Re: Suggestions for dealing with modular characters in Unity? Post by: Gimym JIMBERT on May 08, 2013, 10:57:18 PM http://wiki.unity3d.com/index.php/CombineSkinnedMeshes
http://wiki.unity3d.com/index.php/SkinMeshCombineUtility http://wiki.unity3d.com/index.php/SkinnedMeshCombiner http://wiki.unity3d.com/index.php/SkinnedMeshTools there is certainly better tools on unity store but I didn't checked yet Title: Re: Suggestions for dealing with modular characters in Unity? Post by: meta87 on May 11, 2013, 10:09:08 PM You could do this much more easily with either SmoothMoves (http://www.echo17.com/smoothmoves.html) or Spine (http://esotericsoftware.com/) both of which are Skeletal Animation Systems. You can swap bones at runtime, so change weapon, clothes etc without making multiple animations.
SmoothMoves is slightly easier to deal with because it's built right into Unity, but I'm really liking Spine's interface. Title: Re: Suggestions for dealing with modular characters in Unity? Post by: Gimym JIMBERT on May 11, 2013, 10:22:34 PM These are 2d tools, he hasn't specified
Title: Re: Suggestions for dealing with modular characters in Unity? Post by: meta87 on May 12, 2013, 08:15:46 AM Good point :)
Title: Re: Suggestions for dealing with modular characters in Unity? Post by: Tony Coculuzzi on May 23, 2013, 06:19:46 PM Haha yeah, sorry. I'm making it in 3D, not 2D. Thanks though!
|