Search Unity

Scene folders, what do you think?

Discussion in 'General Discussion' started by Rodolfo-Rubens, Apr 7, 2014.

  1. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,109
    I was looking the ue blog and I found that they will implement this:


    I always wanted this, wonder if UT will implement something like this soon... Also the "main component of the gameObject icon" thing would be pretty awesome too, I always feel losing a bit of my productivity while working on the editor because of the scene hierarchy, and I also feel a bit lost when the scene starts to get bigger, I think something like this would help a lot, mainly the folders! What do you think?
     
    Last edited: Apr 7, 2014
  2. superpig

    superpig

    Quis aedificabit ipsos aedificatores? Unity Technologies

    Joined:
    Jan 16, 2011
    Posts:
    4,232
    I'd definitely like it to be easier to control what's visible in the Hierarchy.

    That said, it is possible at the moment to roll some stuff yourself using HideFlags - you can mark a GameObject as 'HideFlags.HideInHierarchy' and then it (and its children) will be hidden. Useful if you want to e.g. hide all your environment geometry while you're going around placing gameplay items and such.
     
  3. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,109
    The scene view itself doesn't bother me, what really gets me lost is the GOs list, the HideFlags do a wonderful job, before it came out I always wanted something like that, but the folders would be amazing, like you said we can put GOs inside GOs and pretend is a container, but sometimes, for the kind of thing you are doing on code you need your GOs on the scene root, so the folders would be something "imagenary" container, anything inside the folders would be technically on the scene root, also when putting GOs inside other GOs you forget the empty container not on vector3.zero position and every child of it gets messed up.
     
  4. nickgravelyn

    nickgravelyn

    Joined:
    Jan 22, 2009
    Posts:
    143
    You can just use empty game objects like folders. Granted it's not free (they have to be serialized/deserialized, they do take up runtime memory, they may affect the performance of world matrix computation, etc), but it's an option that I use frequently in my games today.

    That said I'd definitely be in favor of a nicer solution to really separate "objects that exist in my scene" and "objects that exist solely to organize my scene".
     
    Ony likes this.
  5. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,109
    That's what I do too, but like you said, sometimes it's not the best thing to do...
     
  6. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,311
    Yeah I use empty game objects as folders. Having actual folders would be nice though.
     
  7. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,430
    Would be great to have, and having a folder icon next to each one, and an icon for each main component in a gameobject (perhaps something you can mark as the main component) will make working a busy scene heirarchy, much easier.
     
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,321
    Well... GameObjects themselves are in fact just containers, or "folders" if you will. The issue is really the Transform that always comes along for the ride. That's where the real cost is, both in terms of performance (though I wouldn't give that much thought) and in terms of workflow and maintenance.

    The Transform requirement of a GameObject is something that's nagged me ever since I started using Unity. I found it hugely offputting for the longest time. I understand that they're required for spatial relationship management, and I understand that there's probably huge performance boosts to storing parent/child relationships in there rather than in the GameObject itself, and it'd probably make scene management significantly more complex if the 1:1 assumption was broken. So I understand why it works that way, and when I thought about it I decided that I'd quite possibly have made the same decision myself.

    But still, some form of Transformless GameObject would rock. It's not exactly uncommon to want something in my scene that has to contain things but should not have a spatial relationship to other things. And when using them solely for organisational purposes, even ignoring the cost (if we've got thousands of transforms what's an extra half-dozen or so going to matter? It's certainly not where I'd focus optimisation time), there's the fact that the Transform introduces the possibility of errors that otherwise couldn't exist.
     
  9. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,494
    I use Hierarchy2 from the Asset Store. When it came out it was like $2 (or $5? can't remember), and when I saw what it could do, I didn't hesitate to buy it.


    Definitely agree with this. It's funny that it's not allowed to call Destroy on a transform component.

    My guess is that this needing for objects to have a transform was an old artifact of the old way the code inside Unity works but was never bothered to be improved on.
     
    thienhaflash likes this.
  10. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,321
    It mightn't be "old". Transforms need parent/child relationships. So do GameObjects. It makes a lot of sense to have this in one place instead of two. That just comes with the downside that the Transform also does other stuff.
     
  11. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,494
    I have no problem with that. What I was referring to is the fact that even though I don't care about x,y,z position, rotation and scale for some objects, like containers for scripts that act as singletons, it's always there.

    Thinking about it more, I assume it's not much benefit to have the option of game objects with no spatial information (they're just a few variables anyway, I guess), but at least have a way to hide them in the Inspector for the game objects that I deem not needing them (i.e. scene folders). Perhaps an editor script can do the trick here. I know you can collapse the transform component, but that's not quite the same since it would hide the transform properties for every object I'm inspecting.

    EDIT: When I said old, I guess look at the name: Transform. It makes me think of "transform matrix", whose job is merely about storing position, rotation, scale.

    Now it has 2 jobs: providing editable spatial properties for the game object, and managing hierarchical properties for the game object.
     
    Last edited: Jun 11, 2014
  12. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    7,071
    It sounds like a "NeutralTransform" class would solve this issue; the scene can still make as much sense as it always has, and NeutralTransform will always assume its position and rotation as (0,0,0) and scale as (1,1,1) (and being a custom class, the properties could never be modified, and can optimize itself and never have to perform any transform/matrix math.)
     
    Rodolfo-Rubens likes this.
  13. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,494
    That would require editing of Unity source code. I don't think UT will bother to do anything of that sort because they have to equally worry about the users who are fine with and used to how things are right now.

    For us users, I think a simple editor script to hide the transform properties in the inspector, on a per object basis, can work as well.
     
  14. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,109
    Sorry to necro this but, please, things are getting intense here, I need folders...
    thanks.
     
  15. Ricks

    Ricks

    Joined:
    Jun 17, 2010
    Posts:
    647
    Rodolfo-Rubens likes this.
  16. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,109
    Hey, thanks for this, I just put my 5 votes there.
     
  17. Imre

    Imre

    Joined:
    Sep 27, 2012
    Posts:
    70
    It took about ~month from request to reality from 'other evil firm' to implement it, let's see how long it will take Unity...ohhh wait it's about 3 years already :oops:
     
  18. Rodolfo-Rubens

    Rodolfo-Rubens

    Joined:
    Nov 17, 2012
    Posts:
    1,109
    sometimes it looks like they don't really care about us...
     
unityunity