Hey everyone, just looking for some feedback, on your experiences or just ideas of what you think is or would be the best way do interchange clothing, Basically, working on a survival game where you find clothes etc, right now we are using just turning the renderers on and off, and its all under the model file, looking for better ways. Any ideas?
Unity has a tutorial project on just that.
I believe the tutorial project simply lumps all objects on the same model the same as what @o1o101 said they were already doing. This system is ok for a few number of items, but it quickly gets unmanageable. What I do on my end is a little different… I have a base character model with bones, and then I have individual clothes/item models with the same bones. When I want to add a piece of clothing to the character I do the following…
- instantiate the clothing object as a child of the character object.
- search through all the bones of the clothing object and attach them as children to the bones of the character object. So for example bone “LeftArm” of the clothing object now becomes a child of the bone “LeftArm” of the character object.
This allows the most flexibility, as you can add additional items to your project at any time. As long as the skeleton is the same then all should work well. You do have to keep track of these bone objects though, and when you want to remove an item you have to also remove all the corresponding bone/child objects.
There are various ways; one would be to have all the clothes together and show/hide them. This is the simplest part, but it is a very amateurish way to do it.
The other way is like Chingwa mentioned; so you instantiate the various cloth items and parent the bones to the body part. But if you need static props and not dynamic cloths (depends from what kind of movement are you planning, and what style of cloth you want), you can save time.
The way in which you plan your game, will dictate how the rigs has to be done. If you buy 3d assets, that would be what dictate your approach; while if you do the graphic (or have someone that does it for you), then you have the freedom to pick what you like best.
I used the approach to model the naked mesh, then rigged it and copied it for as many cloth items I needed, modifying the base mesh and deleting what was not need. This was a rather amateurish way to do it thou, since I would just hide the part of the body when loading the piece of cloth to wear on. But saved me time on the animations
Thanks for the help guys, ill look further into it