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. Dismiss Notice

Question How to work HideFlags.HideAndDontSave

Discussion in 'Editor & General Support' started by Zimaell, May 16, 2023.

  1. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    337
    i have a lot of objects in the scene that i sometimes move, sometimes i need to move an object that has a lot of child objects but they are turned off, but even in the off state it affects performance, is there any point in hiding objects using HideAndDontSave to increase performance?

    that is, the essence is this - I need to move an object that has an animator (in which there are many child objects), if the object is outside the screen, then the animator turns off, but it is still attached to the moving object, but what if we hide it?
    or how can it be disconnected for a while and quickly returned as needed?
     
  2. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    HideFlags is an entire only thing, despite it living in the UnityEngine namespace.
     
    Zimaell likes this.
  3. Zimaell

    Zimaell

    Joined:
    May 7, 2020
    Posts:
    337
    does using these flags affect performance?
     
  4. spiney199

    spiney199

    Joined:
    Feb 11, 2021
    Posts:
    5,769
    Well as it says in the docs:
    So, potentially? You'd have to profile it, but it really only serves a purpose in the editor. It's not a runtime tool.

    The animator component already has a built in options to cull it when it's not being rendered, so I think this exercise is pointless.

    Again, profile, find the true cause of your performance issue, and find a focused solution for it.
     
    Zimaell likes this.