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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Is having the layer of gameobject controlling so much functionality a design flaw?

Discussion in 'General Discussion' started by ArachnidAnimal, May 30, 2018.

  1. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,727
    IMO the layer assignment of a gameobject is used for too many purposes in Unity: camera culling, light culling, physics, light flares, reflection probes. It ends up becoming a huge hassle trying to manage and keep track of all these in a scene.

    I'm wondering if in hindsight Unity wished they would have implemented this differently?

    For example, having to assign a particular layer to a collider just so it doesn't block a light flare seems goofy to me.
    Seems a collider having have a checkbox to "block light flares" would make more sense.

    Does anyone else find it a a hassle to keep track of layers used in a scene?
     
    frosted likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,449
    ArachnidAnimal likes this.
  3. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    4,044
    Agreed 100% - very annoying, especially with the light culling limit of 4.
     
    ArachnidAnimal likes this.
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    I would like if you could have multiple layers on a gameobject, then we could have more a cascading functionally like css classes
     
    ArachnidAnimal and Joe-Censored like this.
  5. MarkrosoftGames

    MarkrosoftGames

    Joined:
    Jan 5, 2012
    Posts:
    442
    thats why i dont use layers
     
  6. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Don't have a problem but I am pretty experienced in Unity and my stuff is well designed with Unity's layer limitations (and they are limitations) in mind. So I don't think it's ever been a show stopper, it just forces you to clearly think about it, and can be quite annoying mid-dev :)

    Ideally each system would have it's own bitmask and the reserved ones would be taken off the table - if we can't use them... why the heck can we see them?

    You cray, Unity!
     
    ArachnidAnimal likes this.
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    You cant write a complex game without them, collision, lights, etc,etc everything uses them.
     
    ArachnidAnimal, frosted and Murgilod like this.