Jump to content

Unity: Model not creating materials


Recommended Posts

I'm trying to get some  new parts in unity (4.2.2) and some of my models aren't creating a material when I load them into unity. I've found out how to make materials but can't assign them to the objects that are missing materials, and I can't make the hierarchy window appear either (by clicking in the menu or pressing ctrl+4).

I did just upgrade to windows 10 and haven't reinstalled unity, not sure if I need to or not. I also think there may be some issue with my UVs, when I assign my texture to the default material sometimes it displays my textures properly and sometimes it displays it like I have no UVs, and sometimes when I duplicate my model in Maya it loses its UVs for some reason.  The googling I've done so far makes me think that Unity only creates a material for a model if it has a UV set so so far I think this may be part of the issue.

Anyone have any advice on how to get materials assigned to models?

Link to comment
Share on other sites

Do you mean the model preview underneath the inspector? I was trying to drag the material onto this and my cursor turned into the "you cant do that" symbol. Do you know if Unity will only create a material for a model that has UVs? I'm at work right now but think this smay be the root of the problem.

Link to comment
Share on other sites

InspectorWindowCallout.png

Drag/Drop your import into the scene. Drop into the viewport or into the hierarchy panel. If you can't find it, go to Windows/Layouts/Revert To Factory.
Once you got the object in the scene, select it, then look in the Inspector per image. Where it says Materials/Size, if it's 0; set it to 1. Drag/Drop a material to Element 0.

You should be able to assign material even without UV. If the UVs are all jumbled, something's not quite right in Maya export side. 

Edited by nli2work
Link to comment
Share on other sites

There's something screwey going on. In the first pic you'll see a textured engine thing and in the heirarchy you'll see the mesh and its collider, and on the right I see those materials settings.  In the second pic I have a model with the default material underneath it in the heirarchy and no materials settings in the inspector.

 

That's all  okay tho, I'm gonna go figure out what version of unity to use for 1.1 and hunt down the new part tools :wink: maybe that'll solve some of this silliness.

Link to comment
Share on other sites

1.1 is built with 5.2.4; but there's nothing wrong with your unity asset. You're selecting the parent object, it has no Mesh Filter and Mesh Renderer component. The material is assigned to "default" object. the hierarchy setup varies depending on what how your scene is setup in the 3d app.

Unity works in components that control behavior of game objects. The most primitive game object has Transform component. You add other components to a game object to turn it into a light, camera, etc. A gameobject without material slot is perfectly normal.

Link to comment
Share on other sites

Copy that, I'm starting to get things working in unity and in game. New issues keep popping up tho, I'm trying to have several of my models share materials/textures and having very strange results. I have a cockpit and a nosecone using the same texture and in game both models and cfg files and the single texture are in the same folder. When I load this in game the nose cone has its proper stats etc but has the same 3d model and texture as the cockpit.  Anyone have a clear walkthrough on setting up shared textures?

Link to comment
Share on other sites

14 minutes ago, LukeTheYeti said:

Copy that, I'm starting to get things working in unity and in game. New issues keep popping up tho, I'm trying to have several of my models share materials/textures and having very strange results. I have a cockpit and a nosecone using the same texture and in game both models and cfg files and the single texture are in the same folder. When I load this in game the nose cone has its proper stats etc but has the same 3d model and texture as the cockpit.  Anyone have a clear walkthrough on setting up shared textures?

 

Shared textures in the same folder work pretty well. But if you have multiple models in the same folder, make sure your CFG uses "MODEL { }" syntax instead of "mesh = " lines. The "mesh" line is pretty much ignored and the part will just use the last MU in the folder.

Link to comment
Share on other sites

8 hours ago, NecroBones said:

 

Shared textures in the same folder work pretty well. But if you have multiple models in the same folder, make sure your CFG uses "MODEL { }" syntax instead of "mesh = " lines. The "mesh" line is pretty much ignored and the part will just use the last MU in the folder.

Yarp, this appears to be what is happening. I'll try this with MODEL{} tonight!

Thanks a ton!

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...