Search Unity

Entities p32: World.Active is null

Discussion in 'Entity Component System' started by Shinyclef, May 17, 2019.

  1. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Is there something about p32 that requires us to manually set World.Active?
    After upgrading, it looks like it's null causing an error.

    ConvertToEntity MonoBehaviours give a warning: "ConvertEntity failed because there was no Active World".
    My own use of World.Active results in null ref exceptions.

    Anyone experience similar?
    Cheers.
     
  2. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I got this too on new test scene I did, however DOTS sample repo samples would still run. In my test I was converting things with Unity Physics so that could be the thing on my end that threw it off.

    There also seem to be tons of different issues with Unity Physics package with p32 so I dunno if this is related. I hope Unity can get new updated physics package out soon :)
     
  3. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Ah, I am also using unity physics. This is probably the common thread.
     
  4. rsodre

    rsodre

    Joined:
    May 9, 2012
    Posts:
    229
    Same happened to me.
    Downgraded to resume work.
     
  5. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Do you have the Unity.Physics package by any chance? If so I might post in the physics forum as I know of another person in the same boat with unity physics too.
     
  6. psuong

    psuong

    Joined:
    Jun 11, 2014
    Posts:
    126
    Hey so I had that too but on my side it is due to the TypeManager throwing an error about the conversion of ISharedComponentDatas.

    So in the CHANGELOG.md file; part of the Upgrade Guide section mentions:

    * ISharedComponentData with managed fields must implement IEquatable and GetHashCode
    * IComponentData and ISharedComponentData implementing IEquatable must also override GetHashCode

    So you need to look through your ISharedComponentDatas that implement managed types (for me it was on the non-blittable types) and override the GetHashCode() and implement the IEquatable interface. After upgrading all of my ISharedComponentData the world was properly constructed and the conversion worked.
     
    Last edited: May 17, 2019
    rz_0lento likes this.
  7. rsodre

    rsodre

    Joined:
    May 9, 2012
    Posts:
    229
    No Physics.
    I have Burst, Collections, Entities, Hybrid Renderer, Jobs and Mathematics.
     
  8. cort_of_unity

    cort_of_unity

    Unity Technologies

    Joined:
    Aug 15, 2018
    Posts:
    98
    Could we get a simple repro case to look at?
     
  9. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    I believe my issue is the same as this, so I'm trying to figure out where I have a managed type in a shared component.

    "ArgumentException: SequenceNode contains a field of System.Collections.Generic.List`1[Unity.Entities.Entity], which is neither primitive nor blittable."

    I can't find any cases of components with managed fields but I'll keep looking for bit and perhaps I'll find something.
     
  10. Shinyclef

    Shinyclef

    Joined:
    Nov 20, 2013
    Posts:
    505
    Okkk well yep, it's from some an experimental behaviour tree concept that is sitting in my concepts folder from ago and isn't used in any systems today heh. Moral of the story, don't assume old concepts are not being picked up by reflection from somewhere!

    I haven't got p32 working yet, but at least THIS issue has been bypassed.
    Cheers :)