Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GameObjects tagged as EditorOnly are no longer compiled into builds

Discussion in '5.3 Beta' started by ramy_d, Nov 5, 2015.

  1. ramy_d

    ramy_d

    Joined:
    Oct 12, 2014
    Posts:
    19
    It would have been really nice to mention that in the release notes.
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    That's always been the case, and is the purpose of the EditorOnly tag.

    --Eric
     
  3. ramy_d

    ramy_d

    Joined:
    Oct 12, 2014
    Posts:
    19
    5.1 did not demonstrate this "new" feature.
     
  4. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I don't have 5.1 currently installed, but 5.0 works the expected way, and so do all other versions as far as I'm aware. If 5.1 really didn't do that, it was a regression bug.

    --Eric
     
  5. Devil_Inside

    Devil_Inside

    Joined:
    Nov 19, 2012
    Posts:
    1,117
    In what use-case would you mark something as editor-only and expect it to be included in the build?
     
  6. ramy_d

    ramy_d

    Joined:
    Oct 12, 2014
    Posts:
    19
    I'm sure the tag works as intended, i'm just raising the issue I experienced with _this_ beta: We've been migrating the same prefabs into new versions of unity since 4.x and only on this beta did objects tagged as editor only completely disappear on us along with their components. We had initially tagged some gameobjects as editoronly so the meshes would not be visible while keeping the component scripts accessible. That was the behaviour we observed and only on this beta did we notice a change and error when making a build.
     
    Last edited: Nov 6, 2015
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    But it's never worked like that. If a GameObject is tagged EditorOnly, it doesn't exist in the build at all. I just tried with Unity 3.5, 4.3, and 5.2 to be sure, and I'm 100% sure. If you want to disable a mesh on an object, the correct thing to do is disable the mesh renderer.

    --Eric
     
  8. ramy_d

    ramy_d

    Joined:
    Oct 12, 2014
    Posts:
    19
    oh well, more Unity weirdness then.
     
  9. ikriz

    ikriz

    Joined:
    Dec 3, 2009
    Posts:
    98