- Home /
Scene view being grayed out while changing gameobject active
Hi!
I'm a programmer and I have stumbled on a weird problem, I am currently working on a animator tool inside Unity. As english is not my main language, I will try to explain the situation thoroughly and I apologize if things are not clear, just ask and i'll try to clarify.
I use a monobehavior script that active and desactivate GameObjects depending on a text file. (text file just tells me the GameObjects that need to be present in the scene, those gameObjects have no script attached, they are only props and terrain objects (house, tree, etc) you get the pictures). This script is attached to an empty Gameobject inside the scene.
So, when I use my script to make those active / non active, the scene view of Unity is all greyed out. Only gizmo's like the 3-d mover, scale, camera sign, are visible. BUT the thing is that on the game view, I can see what the camera see, meaning everything. It is like the scene view crashed or something. Just to point that out, my script needs to be in play mode to work since I need to play animations, but that should not really be a problem since you can play with the gameobject.
I did a google search (yeah I actually did), and tried different approach. I made sure that the layer were all at default to see everything. I tried repainting the sceneview during each call of OnGUI (didn't care for performance, just wanted to see if it would actually work). I tried installing the latest driver, Updated Windows, rebooting the computer but the problem is still there. I can't update Unity for now because of the current pipeline (i'm stuck at version : 4.1.2f1)
The ONLY way I could make the scene refresh itself, was by clicking on the inspector in the editor and pressing the Space bar to maximize the inspector and pressing space again to reduce the inspector view to the normal size. Also, closing and re-opening the scene tab also solves it but that does not really solves my problem because I would like to find a permanent
Here is the script that I use to activate and desactive the Gameobjects, but I don't think that this is the problem because it does happen sometimes when I manually activate and desactivate GameObject in the inspector.
GameObject[] l_oaGameObjects = Resources.FindObjectsOfTypeAll( typeof( GameObject ) ) as GameObject[];
foreach ( GameObject l_oGameObject in l_oaGameObjects ) { if ( l_oGameObject.transform.parent == null && !l_oGameObject.name.StartsWith("AnimationEngine") ) { l_oGameObject.SetActive( in_slShotAssets.Contains( l_oGameObject.name ) || in_oShotToRender.m_slSetAssets.Contains( l_oGameObject.name ) || m_slDefaultAssets.Contains( l_oGameObject.name ) ); } }
Your help would be really appreciated because I am litterally stuck because of this problem and I know the community might be able to help me!
Elmekior