Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by bthomas_unity · Mar 26, 2018 at 07:15 PM · customizationcharacter-animation

How do make interchangable objects on a character?

I'm trying to understand how I would go about creating custom objects to place on a character or another object. For example, if I was making a character that could wear different armor, how would I go about making the different pieces of armor connect to the character the correct way each time? Do I create some kind of connection point on the character and on the armor? Would i have to do things differently if I wanted different armor on different types of characters. For example, if I had a human wearing many different hats vs a dog wearing many different hats, could those hats be the same set of hats? Sorry if this is too many questions to ask at once.

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RobAnthem · Mar 26, 2018 at 07:31 PM 0
Share

Oh buddy, you are not going to like this answer.

You have to 3D model the armor/objects onto the character, all of them, and then disable/enable them as needed. You may be wondering why? Well the fact is that every 3D character has a bone structure, and simply childing objects to the player will not move with the bone structure in any realistic way, your objects need to literally be tied to the bone structure for them to look proper while moving. Now hats are a lot simpler, you can child a hat to the head bone of an entity, but a helmet may require modeling.

avatar image bthomas_unity RobAnthem · Mar 26, 2018 at 07:36 PM 0
Share

I actually love this answer, it helps me out a lot! Would I have to worry about bone structure on things that don't have bones? Like if I wanted to put different kinds of flowers in pots or something like that.

avatar image RobAnthem bthomas_unity · Mar 26, 2018 at 07:43 PM 1
Share

No, not at all, this only applies to objects with bones that are animated. If you want to do something like a plant, you could easily create the Pot for the plan, put an empty GameObject in it you label Anchor or something, and use that to instantiate the plant onto, OR you can put a few different flowers in a Pot and create a script that sets specific ones active, I actually did something very similar to this for a game I'm working on that allows you to customize certain areas. The idea is that all objects exist in the same location, just not at the same time. An example would be.

 public class PlantController
 {
     public GameObject[] plants;
     public int current;
     void Awake()
     {
         SetPlant(current);
     }
     public void SetPlant(int id)
     {
         for (int i = 0; i < plants.Length; i++)
        {
            if (i == id)
            {
                 plants[i].SetActive(true);
            }
            else
            {
                 plants[i].SetActive(false);
            }
        }
     }
 }


Also, there's a lot of tutorials on making clothes/armor, the base idea comes down to this: In a 3D program like Blender, you import your character, select the areas which the armor will be, like for a chest piece, you'll select the chest, back, and if it has arms, then the arms as well. Then you duplicate those vertices, and separate them to become a new object, but still linked to the bones, and alter your newly copied vertices. Its actually a lot easier than it sounds, and if you're even remotely decent at 3D modeling, you'll have it figured out in a few hours.

avatar image Martin_Gonzalez RobAnthem · Mar 26, 2018 at 07:43 PM 1
Share

He don't need all of them disabled. He can instantiate them on runtime ins$$anonymous$$d of having n disabled armors. But it's an approach.

avatar image RobAnthem Martin_Gonzalez · Mar 26, 2018 at 07:51 PM 1
Share

While that is true, unless he's making 100's of armors, it's more efficient to have them all loaded at start, since in most cases people swap gear out constantly. Of course, the efficiency is very dependent on the level of detail on the armors. Obviously having 10x 100k vertice chest pieces is not efficient.

Personally, I like to lazy load things, instantiating as needed, but disabling ins$$anonymous$$d of destroying, so that next time I would instantiate it, ins$$anonymous$$d I just enable it.

Of course, let's not forget that unless he's doing Resource.Load(), then all of his armors are already in the RA$$anonymous$$ and instantiation actually takes longer, and requires 2 of the objects to exist now.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Martin_Gonzalez · Mar 26, 2018 at 07:34 PM

You can create a hat and place it over an empty gameObejct working like a bone in 3d frameworks. So you can set up the gameObject in the place you want (can be the center of the head, the side of it) so the you instanciate the hat in the exact position and rotation of the empty gameObject and place it as the parent of the hat, so if the gameObject is in the player or dog, when the player or dog moves the gameobject will move and the hat too.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image bthomas_unity · Mar 26, 2018 at 07:46 PM 0
Share

Awesome! Thank you very much

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

76 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Charcer Customization with Unity Indie? 4 Answers

Customizable Unit 2 Answers

Turn Currently Held Button Into A String(C#) 1 Answer

How can I create diablo 2 like characters? 1 Answer

Responsive Editor UI Button with custom style | How to remove GUIStyle.hover delay 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges