(03-02-2018, 09:20 PM)josemendez Wrote: Hi there,
This happens when an object with the hide flag HideAndDontSave is not properly destroyed.
The rope mesh is created in ObiRope's Start() and destroyed in ObiRope's OnDestroy(). So rope and mesh should always be created and destroyed together (at least in theory). For some reason the rope was removed from the scene without OnDestroy() being called, possibly the result of Unity crashing or a bug of some sort. We've been unable to reproduce it with ObiRope, but has happened for us in the past with other assets and even with Unity's own components, that's why I recognize the problem.
Unity won't let you see this mesh in the hierarchy or select it, because it is marked as HideAndDontSave. It will stay in the scene permanently until you destroy it. The only fix for this is to access all Mesh components that have this hide flag trough an editor script and remove them from the scene by calling DestroyImmediate(). It's just a couple lines of code, but let me know if you need help with it.
kind regards,
I could write a script to excute DestroyImmediate() in the Editor, but I want to know how to permanently avoid this issue.
A little more on how I'm using it. I have the chain in an area of my map that isn't viewable when the player enters. I'm currently disabling the obi rope gameObject to save resources and then enabling it once the player is close. I never destroy the GameObject. I am using additive scene loading (if that makes a difference).
Is there a better way to ensure its using zero resources and to make sure this issue doesn't occur? I'm making a VR game, so I really need it to be zero (CPU & GPU) when not viewed as my budget for everything is very strict.
Thanks.