Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Unity 2018.3 is now released.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[SOLVED] Entity Batch Destroy & Create in single frame with same model + position is noticeable

Discussion in 'Entity Component System and C# Job system' started by meanmonkey, Dec 5, 2018.

  1. meanmonkey

    meanmonkey

    Joined:
    Nov 13, 2014
    Posts:
    85
    I have a custom / sectorbased lod system where I batch create & destroy using

    EntityManager.DestroyEntity(entityNativeArray1)
    EntityManager.CreateEntity(entityNativeArray2)

    in one single frame. For testing purpose, the models for each lod is exactly the same.

    The problem is, the gap between destroy and create is absolutley noticeable, to my confusion (meaning I see the old entity disappear and the new one (same model, same position) appearing with a blink).

    What is unity doing there under the hood? Is the spreading the batch create/destroy over multiple frames ?

    If yes, can I force somehow to do it in one frame?
     
    Last edited: Dec 5, 2018
  2. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    937
    I believe they are both instant, what if you try to place your EntityManager commands at a system positioned at UpdateBefore(Initialization)?
     
    meanmonkey likes this.
  3. meanmonkey

    meanmonkey

    Joined:
    Nov 13, 2014
    Posts:
    85
    As it turns out I shot too fast :D

    No problem with unity ecs at all, it was a system udpate order problem, specific to my own coding.

    So @5argon your idea was absolutely in the right direction, even if it wasn't UpdateBefore(Initialization), but a update order problem between my systems.
     
    5argon likes this.