Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved No Entities visible after upgrading to 1.0

Discussion in 'Graphics for ECS' started by charleshendry, Dec 23, 2022.

  1. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    I recently upgraded to Entities 1.0, but now none of my Entities are visible anymore. I create them in subscenes and they're then instantiated from there. I can see all the Entities being created but none are visible. The attachment shows an example entity during runtime.

    The only thing I've noticed is that the MaterialMeshInfo values don't seem correct. I've not edited any of the default components though.

    EntityComponents.png
     
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    There doesn't seem to be anything obviously wrong with this Entity data.

    Do you see the Entity rendering in e.g. the Frame Debugger and/or RenderDoc? Are there any error messages in the console?
     
  3. TieSKey

    TieSKey

    Joined:
    Apr 14, 2011
    Posts:
    228
    Check the bounds are not set to all 0. There was a bug(?) in previous versions where it was automatically set to 1 (or bigger, don't remember) but now it is initialized to 0 which in turn prevents rendering.
     
    charleshendry likes this.
  4. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    In the scene view during runtime it matters that the subscene is 'closed'.

    In my conversion to 1.0 a main problem was the translation, could it be that the objects are not at the right position or have a scale of 0? (If you use new LocalTransform(), the scale is set to 0. So you always need to use LocalTranform.From...())

    You could try to just add a 'default cube' with a 'default lit material' to the subscene and see if that works, just as a sanity check.
     
    charleshendry likes this.
  5. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    Thank you!! That did it. I was instanciating the subscene entities and setting new LocalTransformsfor them, but only setting Position and Rotation, which ends up with scale as zero. I'd assumed it would default to 1. So render bounds end up as zero as well. Everything is finally back now.
     
    Arnold_2013 likes this.
  6. phreezie

    phreezie

    Joined:
    Oct 3, 2019
    Posts:
    119
    I have the same problem, all objects in the sub scene disappear and aren't visible in the game view even when the game is stopped.

    upload_2023-2-5_22-35-47.png

    Adding a cube to the parent scene works, moving it into the sub scene makes it disappear again. The scale and position seem to be fine.

    Note that I'm not using Entities.Graphics. This worked in v0.17 by not destroying GameObjects after conversion, but it might be an issue with v1.0. I still can see the GameObjects during play. If someone can confirm that GameObjects are never destroyed with v1.0, that'd be a source of error I could eliminate. Other hints or suggestions about the disappearing objects would be even more appreciated. :)