Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

unity 5 3. Cant disable canvas game objects / grey scripts

Discussion in 'Editor & General Support' started by correptus, Dec 10, 2015.

  1. correptus

    correptus

    Joined:
    Apr 14, 2015
    Posts:
    17
    Hello. I have some problems with unity 5 3.
    1 I cant disable some game objects under the canvas, it just does not work. I tried in editor, tried in sctipt (gameObject.SetActive(false) ; nothing. So i cant disable my GUI / menu elements.
    2 all scripts attached to game objects are grey, i dont know what it is, just asking.
    They look like this:
    Скриншот 2015-12-10 12.00.57.png
    all of them.
     
    Last edited: Dec 10, 2015
  2. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    If you add OnEnable or OnDisable to your script, it will show you the toggle to activate and deactivate the script in the editor.
     
  3. correptus

    correptus

    Joined:
    Apr 14, 2015
    Posts:
    17
    Yes, but i need to disable gameobject not script.
     
  4. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Can you show a screenshot showing the hierarchy and the inspector with a misbehaving game object selected?
     
  5. correptus

    correptus

    Joined:
    Apr 14, 2015
    Posts:
    17
    Yes.
    Скриншот 2015-12-10 14.57.41.png
    Here i am clicking the checkmark and nothing happens. gameObject.SetActive(false) also does not help.
     
  6. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    It looks to me as if you are having a script that automatically activates the game objects. Do you use [ExecuteInEditMode] in your scripts?
     
  7. correptus

    correptus

    Joined:
    Apr 14, 2015
    Posts:
    17
    No I have no edit mode scipts. And it is not the only problematic object. And not only on this scene. I cant recreate it but i noticed that it happens only on canvases.

    Edit:
    So I created new Canvas with same settings and moved all gameobjects to the new one, and now problem solved. Seems like a bug that i cant recreate, all i can remember what ive done unusual for me is draging this canvas(broken) from the other scene trough new multiscene editing tool.

    Scrits are still grey.
     
    Last edited: Dec 10, 2015
  8. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    Does this also happen when you create a canvas in an empty scene and add e.g. the HUD as a child in there?

    I don't have any experience with multi scene editing. So I wouldn't be surprised if it is related in any way.