Search Unity

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:
    21
    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?