Search Unity

How to disable (hide) UI elements without disabling them

Discussion in 'UGUI & TextMesh Pro' started by Aurecon_Unity, Nov 25, 2014.

  1. Leohd

    Leohd

    Joined:
    Feb 7, 2017
    Posts:
    32
    Sorry for being a necromancer, but I have my own solution that might help you. Instead of disabling the canvas, I shrink it to a tiny object that is not visible when needed, then scale it up when necessary.
     
  2. Rispat-Momit

    Rispat-Momit

    Joined:
    Feb 14, 2013
    Posts:
    266
    For hiding the whole canvas while keeping all functions, I am changing Target Display on the canvas component :)
     
    Last edited: Mar 11, 2021
  3. MartinMa_

    MartinMa_

    Joined:
    Jan 3, 2021
    Posts:
    455
    yourUI.transform.localScale = new Vector3 (0,0,0);
     
  4. MimiKitty

    MimiKitty

    Joined:
    Dec 13, 2018
    Posts:
    20
    I know is old, but I ran into this as well. you can just disable the canvas component and all UI below it stop being visible. was this not an option before? is this a new option?
     
  5. neviovalsa

    neviovalsa

    Joined:
    Jun 24, 2019
    Posts:
    52
  6. Gamer_Tom

    Gamer_Tom

    Joined:
    Apr 10, 2023
    Posts:
    5