Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 Sohaib08 · Jul 25, 2012 at 03:12 PM · meshmaterialrenderinvisiblereplace

Mesh wont render/ appears invisible

Hi there,

I'm trying to swap out the current torso mesh of my character with an armored mesh but things don't seem to be happening right. The current mesh just disappears and when I check the inspector on run the mesh and material are empty. Here's my code:

 var oldmodel: GameObject = pc.myTransform.GetChild(1).gameObject;

var Swapper : SkinnedMeshRenderer = oldmodel.GetComponent(SkinnedMeshRenderer);

var SwapMesh: Mesh = Resources.Load("eq_chest_025", Mesh);

var SwapMet: Material = Resources.Load("dragonarmor", Material);

Swapper.sharedMesh = SwapMesh;

Any help would be appreciated. I also tried setting the shared material but no avail.

-Sohaib

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
0
Best Answer

Answer by Sohaib08 · Jul 25, 2012 at 05:16 PM

Well it seems like I'm getting closer to a solution. The meshes that work have uvs and skins and those that don't just have uvs. I get this error if I try to replace the mesh "Number of bind poses doesn't match number of bones in skinned mesh." Turns out that only models with armatures/bones are skinned so they can be replaced; Does that mean I have to import the whole armature aswell? I'll try and let you guys know...

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 DESTRUKTORR · Jul 25, 2012 at 04:13 PM

Chances are, it's not been properly scaled in the prefab for the mesh. Try checking it, and make sure it's not set to 0.01 (which, I believe, is default).

Comment
Add comment · Show 3 · 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 Sohaib08 · Jul 25, 2012 at 04:18 PM 0
Share

Nope, the mesh prefab is set to scale 1.

avatar image Sohaib08 · Jul 25, 2012 at 04:33 PM 0
Share

But here's something interesting some of the meshes have both uv and skin and those show up, where as some only have a uv and no skin and they don't. Can anyone explain?

avatar image DESTRUKTORR · Jul 25, 2012 at 04:37 PM 0
Share

Check that the applied material isn't set to "none." If there's no texture applied, none will show up.

Also make sure the normals are facing the right way.

avatar image
0

Answer by Sohaib08 · Jul 26, 2012 at 01:35 PM

Yup, importing with armature works if you're using blender. I agree it's holding extraneous data that could increase each mesh up to about 200KB but that's my fix. There is a character Assets Bundle I could have looked into using bone transforms and whatever else like in the character customization demo, but I'm gonna stick with what's simple. Thanks!

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 scarletsnake · Dec 26, 2012 at 03:03 AM

Go into the model's specific mesh parts and assign them from your newly imported file. Under Skinned Mesh Renderer's Mesh tab it'll say Missing (Mesh). Click that and assign from there.

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

7 People are following this question.

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

Related Questions

Mesh with copied material not showing in Game View and Forward Rendering Path 0 Answers

Textures not showing up 0 Answers

Create multiple meshs in one mesh 0 Answers

can't put texture materials on imported mesh. 1 Answer

Set an object to invisible? 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