Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feedback Physics Debug Display as singleton

Discussion in 'Physics for ECS' started by torsina, Jun 19, 2020.

  1. torsina

    torsina

    Joined:
    Jan 24, 2020
    Posts:
    2
    Hi,

    I've been trying basic stuff on dots for a few months now and wanted to use the Physics Debug Display component to my scene.

    I added it to a prefab I was spawning multiple times in my scene, because I thought each Physics Shape had to have their own debug component

    InvalidOperationException: The NativeArray has been deallocated, it is not allowed to access it (Unity.Physics.Authoring.DisplayBodyColliders+DrawComponent.OnDrawGizmos () (at Library/PackageCache/com.unity.physics@0.3.2-preview/Unity.Physics.Hybrid/Utilities/DebugDisplay/DisplayCollidersSystem.cs:544)

    It seems like unity already tries to not create the Component multiple times if they're present at start time. But in my case I had a GO having it at start time; and multiple GO having it being created at runtime to be converted to entity, so it somehow went around those restrictions.

    It would be really helpful to put a warning/error in the condition that checks if the
    PhysicsDebugDisplayData is a singleton in DisplayBodyColliders#OnUpdate say that this *should* be a singleton if the amount of entities in the query is greater than 1. I spent a long time on this and I hope this to noone else.

    Thank you!
     
    Nothke and steveeHavok like this.