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 Foestar · Apr 23, 2020 at 01:25 AM · renderermodelsmeshrenderermodel importingarmor

Issues with SharedMeshRenderers and changing them (aka, armor and helms)

Hey all, so my current project is pushing me to learn how to do armor and helm changes on my character model. I've never done this sort of thing before but felt like I was up to the challenge!

At the moment I have a single character model which serves as the base. I then added in a armor mesh, and a helmet mesh. Both are separate objects within the same 3DS Max file. I then rigged all 3 objects, (Skin, Armor, Helm) to a biped with excellent results. I took the same base and did this for 3 more sets of armor and helmets with the intention of switching them out via script at runtime. This is where the challenges first started coming in.

I made a color picker setup and allowed the player to change their characters skin color which works fine. But as I switched the skins I found some very odd results. Before continuing I would like to note that before I made all these armor and helm models I tested my theory using a simple model of him naked and another with armor and it worked perfect. But with my new armors and helms only 3 work as intended, the other 1 does not. It does the same thing as the armors, where it skews all crazy!

So at this point I thought I'd do some reviewing of my objects individually. So when dragging and dropping my models into the editor and reviewing each helmet I noticed that 3 (all the working ones) had the same root bone on that mesh where as the one that didn't had a different root bone. If I changed the rootbone to the same as the others then applied those others to that one it seemed to work perfectly fine. It was at this point that I realized my issue may have been with bones. Though I'm not sure why only that one was different as all helmets were rigged exactly the same. So not sure why it imported differently.

So if you want to see a video on this issue you can see it on my forum post here.

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

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by Foestar · Apr 28, 2020 at 06:37 PM

Bwahahahahahahahahaaha! I finally got it! I found out how to properly switch meshes despite having different rig setups without having to stitch together stuff or long coding!!!!! It was such a frustrating learning experience but so satisfying once I had it!

So the issue is when switching meshes the meshes must have similar bone setup otherwise they don't work. It gets all skewed, implodes, explodes, etc. And you can't just grab the correct bones from the prefab of the armor. Doing this would make the mesh properly skin, but not at the right location or to the biped we are using either because we are grabbing those bones specifically from that other skeleton which wont work for this one.

This made me think about how I go about getting the right bones from the proper skeleton. Then it clicked! I need a list of the bones in the armor required, then check through the bones of my current rig and fetch them into a list. I can then apply this list to my current mesh after it's been changed to the one I want.

So now my meshes and armors are fully changeable despite their bones with only like 20 lines of code. Or about 40 if you include the reference array for each armor, helm, and skin color.

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

127 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

Related Questions

Need to set updateWhenOffscreen, but no SkinnedMeshRenderer is present 1 Answer

How to make an object appear after collision with an invisible object. I have tried a lot of ways, but still failed please help! 1 Answer

Changing two different objects renderer colour 1 Answer

Material Instance Created in Car Model Prefab 0 Answers

Model Structure for game 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