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. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  3. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Sprites are still rendered when Disabled component is added through code

Discussion in 'Project Tiny' started by Frickinlaser, Aug 14, 2019.

  1. Frickinlaser

    Frickinlaser

    Joined:
    Jan 19, 2014
    Posts:
    22
    I have an entity with several child entities, each with their own Sprite2DRenderer.
    When I add the Disabled component to the entity in the editor, all child entities also gets disabled and the sprites are no longer rendered. This is what I want.
    However, when I add the Disabled component through code, the sprites are still being rendered. All other systems no longer register the entity, so the Disabled component have successfully been added.

    Do anyone have a clue about why this is happening?