Some context:
I’m using Unity Serializer to serialize a hierarchy of mesh in order to save it or send it to another app. I can save the meshes in a file in Project A and then load them up again, still in Project A. I can also transfer the data to Project B while it is running to have it display the meshes. Things are looking good and I can see the objects in Project B like I’m supposed to.
That is, everything works great while I’m in the Unity Editor. When I build Project B and launch the executable, I cannot see the objects in my scene. Of course, since it’s in Release mode, I cannot simply inspect the objects. What could make an object invisible only in release mode?
Here’s what I tried:
- Through code, I can see that my gameobject does exist
- That gameobject has a parent, the Hierarchy Root, which has no parent
- Both object have normal Position, Rotation and Scale
- If I spawn a primitive at my mesh’s position, the primitive will be displayed
- Both the mesh and the root are activeInHierarchy==true, use layer 0 (default) and are untagged
- The mesh has a renderer (CubeMesh) which is enabled, and a MeshFilter (CubeMesh)
- Changing the renderer.material to a known good material has no effect
- Cloning the gameobject will not display the clone
- The mesh has for components: Transform, BoxCollider, MeshFilter, MeshRenderer and some components for the serialization
- I can interact with the scene, it isn’t frozen
I’m a bit lost for words. Are there any other attributes which could hide an object?
The Serializer could be the problem, but loading the meshes from a file (same method, just different way to get the byte array) works just fine, even in a Release Build.