- Home /
Character Customization
When I say this, I do not mean the extensive library of games such as Saints Row. I have a prefab set up with different clothing , and within this prefab if I activate one and deactivate the other, it fits perfectly giving it that mix and match freedom.
Main Prefab -Warriors Bones --Misc. Bones -Hair1 (Active) -Hair2(Not Active)
I know I would probably use gameObject.Setactive, but how ? Say I have Menu Buttons set up to the side, and each button with activate hair, and deactivate the last. Or even arrows that when clicked go through a cycle. If anyone could point me into the right direction it would be wonderful. I figured a script stating Vars for each Hair piece would be somewhere to start ?
I can understand actually. Do you know of any tutorials that would cover this ? I can pick up things pretty easily without needing to go through vigorous basics learning, but so far coding has convinced me I need to take learning a different way.
Take a look at htse two threads, they show how you can have clothing that fits a skeletal strucurre perfectly by re-using the rig you use for the character modoel.
http://answers.unity3d.com/questions/44355/shared-skeleton-and-animation-state.html
http://answers.unity3d.com/questions/668332/weightless-bones-dont-get-added-to-skinnedmeshrend.html
Answer by christoph_r · Sep 27, 2014 at 11:28 PM
If that's all you need you can utilise Unity's editor to the fullest (if your game object you wish to customise isn't instantiated in run-time): Simply create a public list of game objects for each type of part you want to swap. You can then use your menu buttons to cycle through it, by storing an int as an index for the currently active game object (let's call it currentIndex). When the player clicks the cycling button, disable the current game object using your list and int variables, then update your currentIndex variable and do basically the same thing to enable the new game object. Hope that gave you some ideas on where to take this.
Your answer
Follow this Question
Related Questions
GUI letters number text custom 0 Answers
Switching between scripts within the inspector using code 1 Answer
Customisable Characters/Objects 0 Answers
Where do I post scripts for the Unity community? 1 Answer
Rigidbody FPS controller? 0 Answers