|
Quickest way to produce the problem in c#: REMEMBER to name it asdf.cs AND to assign the script a model AND to place the script on a model. The problem: play the game. Now quit it. The mesh disappears from mesh filter. REMEMBER to reimport the model to test again. Important Details: Hit play after reimporting, and click on your model inside the project panel. In the inspector, scroll down where you see the tab "Imported Object" and look at the mesh filter, the mesh has became "Type misMatch". I tried my best make this as detailed yet short as possible, if you request that I get more information please tell me. (and how, if needed , since I'm a beginner) EDIT: I am using Mac OSX 10.6.8 and I am using Unity version 3.5.2f2.
(comments are locked)
|
|
I got this same problem. Couldn't figure out the why, but found a different work around. If you are not going to be modifying the mesh you can use something like. With the sharedMesh you are calling the actual Mesh(mother) and not the instantiated shape(daughter). Just remember that if you modify this sharedMesh all of the objects that use it will be modified as well. Check the documentation for more info :)
(comments are locked)
|
|
SOLUTION: create a public Mesh of that model and assign it to the model. SCRIPT: Now you can never lose the mesh, however this is more of a workaround of a bug that should be reported than a solution.
(comments are locked)
|

Sounds like should be a bug report. I assume you have tried MeshFilter meshFilter = thing.GetComponent<MeshFilter>(); Debug.Log(meshFilter.mesh); which may give different results. Not really sure what mesh 'to string' will do.....
I will look into it more later, but I found that one could cheaply hack by adding the mesh as a public variable, and assigning it to the model. thing.GetComponent().mesh = publicmesh;
What a very weird problem, I might have to bug report it if the things you said gave the same result.
The fact that the compiler doesn't complain about the "Type misMatch" scares me.
EDIT: gosh, just merely mentioning the string makes it lose the mesh. Looks like I might have to report a bug.
1) What type mismatch? 2) I followed your steps and the mesh does not disappear.
Could be an issue special to my computer. I am using Mac OSX 10.6.8, But if there's anything more I could say let me know.
If it produced the bug, where it would say the name of the mesh with a circle on the right (like cube or plane), it would turn into "Type misMatch"