Search Unity

Question Subscene + convert and inject GO not working

Discussion in 'Entity Component System' started by aveakrause, May 22, 2020.

  1. aveakrause

    aveakrause

    Joined:
    Oct 3, 2018
    Posts:
    70
    I'm trying to use NavMeshObstacle for my doors, the doors are in a subscene, and have to stay there. I can't seem to find a way to force the object that has the NavMeshObstcale to inject.... Does subscene not support that? if so, I'm going to have to delete almost every subscene I have, because mono's can't reference a GO in another scene (either base, or another subscene) to store a reference to specific entities upon conversion. (such as a switch that opens a door, the switch and the door must both be in the the same scene, but my switch has to be in the same subscene as all the other entities that it needs. (I activate rooms/units/doors upon pickup)

    Ideally, can we just get NavMeshObstacle support for DOTS yet so I don't have to inject the GO at all?

    I understand that the subscene ignores the convert to entity component, so how else am I supposed to specify which of them get injected?

    ORRRRRR just add FOLDERS (this seriously has to be the next most asked for feature after free dark mode) to the hierarchy so we can ditch this broken (and has been broken) subscene workflow? This idea that I need a MASSSSIIIIIIVVVVVVVEEEEEEE unorganizable list inside of my hierarchy is just silly. Let me organize. please. Organization is key.

    These are the entities I want. With the NavMeshObstacle, etc.


    But when I close the subscene, they get destroyed.
     
    Last edited: May 22, 2020
  2. DreamersINC

    DreamersINC

    Joined:
    Mar 4, 2015
    Posts:
    131
    Subscences covert everything to Pure ECS at this time. So the navmesh obstacle is going to get trashed on conversion. No way to fix this.
     
    Nyanpas likes this.
  3. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    This is actually false, you can create your own GameObjectConversionSystem and use AddHybridComponent to keep the NavMeshObstacle as is. For reference, here is a very well written article about it and many other features: https://gametorrahod.com/game-object-conversion-and-subscene/
     
  4. DreamersINC

    DreamersINC

    Joined:
    Mar 4, 2015
    Posts:
    131
    Actually that method only works for certain things, Animator and Navmesh are not supported as the last time I attempt to use them as such.
     
  5. aveakrause

    aveakrause

    Joined:
    Oct 3, 2018
    Posts:
    70
    so I have to find a way to program my own NavMeshObstacle is what you're all saying? >.> frustrating. I guess I'll just decompile it in ILSpy and use whatever the heck Unity has as reference, providing it's not riddled with C++ calls like a lot of legacy Unity stuff.

    Stupid stupid stupid stupid internal calls all over NavMesh. Damnit. Ugh. Unity's NavMesh stuff is a freaking disaster to work with. Consistantly.
     
    Last edited: May 22, 2020
  6. DreamersINC

    DreamersINC

    Joined:
    Mar 4, 2015
    Posts:
    131
    DOTS is still in preview. This is one of the reason why it is not recommended for usage yet. There are a lot of thing that still need to be implemented.
     
  7. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    If it makes you feel any better, A* Pathfinding Project has the same problem with subscenes. It has cleaner code than navmesh, but since it was designed for game-objects, you can't put any obstacles in a subscene because it's not able to account for objects in a subscene. So you end up with a nasty long list in the main scene and you don't get the benefits of fast subscene loading.