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 Sannerex · Dec 09, 2016 at 09:18 PM · animationrenderingmodeling

How to put clothing/armor on a character but not remove hair or related parts of the body?

In The Sims 4, when you equip a character with a hat, for most hairstyles, the hat does not replace the hairstyle. Instead, for most hair, the hat seems to go on top or connects to the mesh of the hair. If the character has an afro for example, the hat seems to deform (not entirely remove) the hair in order to go on the character's head.

How would I implement something like this?

Comment
Add comment
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

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Pinkuboxu · Dec 12, 2016 at 08:29 AM

When I did modding for Sims2, you just created a new body mesh for hair and clothing to go with it and built around what you had made logically, or better to say you create and conform to a form factor on your meshes, to keep your modeling work to a minimum. It's a bit tedious but since you are removing polygons that are covered in your mesh it is a good method performance wise. I dunno about Sims 4 as I don't mod anymore but code and model for my own stuff and Unity so I've no idea exactly how Sims 4 does it's mesh attachments.

Scripting a means to alter your meshes polys during runtime using OnCollision is... probably not ideal (I'm going to say bad idea or not possible) given how slow mesh collisions work and that they don't have anything to do with vertices/poly data that you can use to remove anything. Instead you probably want to learn to make algorithms for procedural mesh generation. If you know what I'm talking about you probably have considered it. You also have to think about where you want that done, usually during a loading screen or when there isn't any game action happening because the calculations can be slow. Not as slow as trying to use built in collisions though. So it may not be fast enough to have equipment change happening during a multiplayer battle. Here is a primer. link text

Perhaps an intermediate method, when I'm too lazy to make a bunch of meshes, I make shape keys (called blend shapes in Unity and Maya) in blender to conform/deform/hide the places in the character/hair mesh to move where the other mesh, like a hat, hides it. You are basically making a slider in blender, that unity can use, that moves the vertices out of the way or under the attachment. You have to do this for each case that your attachment doesn't look right. So you still need a form factor to keep your work to a minimum. You'll need a C# script to tell it what Blend Shape to use when that item is equipped. (Blend Shapes are called Shape Key in blender, sorry if that's redundant but just making sure you know they are almost the same but called differently in each program). I make an "OnEquipped" event that will tell the target mesh what blend shape to use when that item is equipped. Might not be as good on the polygon budget, as it doesn't cull or remove anything, but I find it a little more neat and dynamic for some cases.

Here are some other tutorials that might help.

This one focuses on blender shape keys and characters but not exactly what you are doing. link text

This is a fairly long tutorial series that will help you with blend shapes, though it focuses on using the morphs to make custom characters in unity itself, but probably isn't exactly what you are looking for. This is just to help you understand what you might need. link text

Comment
Add comment · 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
0

Answer by Wolfshadow · Dec 09, 2016 at 09:53 PM

Maybe have the hair as a bunch of seperate points, and when the hat goes on the head, it deletes all the points it touches. Just an idea, you could use OnCollisionEnter()

Comment
Add comment · 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
0

Answer by RobAnthem · Dec 09, 2016 at 09:58 PM

There's really only one way to make it look nice, and that is to Import your Model AND clothing into Blender, and put them together the way you want, you can even make equipping animations. If you have a body with an armature, then putting gear on them in Blender is a breeze.

As a side note, I saw this because programmatically deforming or deleting vertices to accommodate a hat is going to be less-than-perfect.

Comment
Add comment · Show 2 · 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 Wolfshadow · Dec 09, 2016 at 09:59 PM 0
Share

true. if you wanted a nice clean look, that would be better. So do you want clean or easily repeatable?

avatar image Sannerex · Dec 11, 2016 at 05:54 PM 0
Share

I am ai$$anonymous$$g towards clean looks. Using your method, would I have to create a different hair+hat model for each hairstyle?

avatar image
0

Answer by theANMATOR2b · Dec 09, 2016 at 11:37 PM

I've not played the Sims games, though I'm sure the afro mesh is also swapped out when the hat is put onto the head, for a mesh that conforms to the hat.

Simple, clean and easily repeatable.

Comment
Add comment · 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

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

131 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 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

Can I Use Multiple Models In One Main Model? 0 Answers

Swapping out models on a skeleton? 1 Answer

How can I solve animating objects rendering behind static? 0 Answers

Basics for character modeling and animation 1 Answer

how to use 3ds max models in unity 3d? 2 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