docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PhysicsDebugDisplaySystem

    A system which is responsible for drawing physics debug display data. Create a singleton entity with PhysicsDebugDisplayData and select what you want to be drawn.

    If you want custom debug draw, you need to:

    1. Create a system which updates before PhysicsDebugDisplaySystem.
    2. In OnUpdate() of that system, call GetSingleton PhysicsDebugDisplayData (even if you are not using it, it is important to do so to properly chain dependencies).
    3. Also in OnUpdate(), obtain the DebugDraw singleton component and use its methods (Line, Triangle, etc.) to draw your custom debug data.
      IMPORTANT: Drawing works only in the Editor.
    Inheritance
    object
    ComponentSystemBase
    SystemBase
    PhysicsDebugDisplaySystem
    PhysicsDebugDisplaySystem_Default
    PhysicsDebugDisplaySystem_Editor
    Inherited Members
    SystemBase.Dependency
    SystemBase.CheckedStateRef
    SystemBase.CompleteDependency()
    SystemBase.Update()
    SystemBase.GetComponent<T>(Entity)
    SystemBase.SetComponent<T>(Entity, T)
    SystemBase.HasComponent<T>(Entity)
    SystemBase.HasBuffer<T>(Entity)
    SystemBase.GetComponentLookup<T>(bool)
    SystemBase.GetComponentDataFromEntity<T>(bool)
    SystemBase.GetBuffer<T>(Entity, bool)
    SystemBase.GetBufferLookup<T>(bool)
    SystemBase.GetBufferFromEntity<T>(bool)
    SystemBase.GetEntityStorageInfoLookup()
    SystemBase.GetStorageInfoFromEntity()
    SystemBase.Exists(Entity)
    ComponentSystemBase.Enabled
    ComponentSystemBase.EntityQueries
    ComponentSystemBase.GlobalSystemVersion
    ComponentSystemBase.LastSystemVersion
    ComponentSystemBase.EntityManager
    ComponentSystemBase.World
    ComponentSystemBase.SystemHandle
    ComponentSystemBase.SystemHandleUntyped
    ComponentSystemBase.Time
    ComponentSystemBase.WorldUpdateAllocator
    ComponentSystemBase.ShouldRunSystem()
    ComponentSystemBase.GetComponentTypeHandle<T>(bool)
    ComponentSystemBase.GetDynamicComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetBufferTypeHandle<T>(bool)
    ComponentSystemBase.GetSharedComponentTypeHandle<T>()
    ComponentSystemBase.GetDynamicSharedComponentTypeHandle(ComponentType)
    ComponentSystemBase.GetEntityTypeHandle()
    ComponentSystemBase.RequireForUpdate(EntityQuery)
    ComponentSystemBase.RequireAnyForUpdate(params EntityQuery[])
    ComponentSystemBase.RequireAnyForUpdate(NativeArray<EntityQuery>)
    ComponentSystemBase.RequireForUpdate<T>()
    ComponentSystemBase.RequireSingletonForUpdate<T>()
    ComponentSystemBase.HasSingleton<T>()
    ComponentSystemBase.GetSingleton<T>()
    ComponentSystemBase.GetSingletonRW<T>()
    ComponentSystemBase.GetSingletonBuffer<T>(bool)
    ComponentSystemBase.TryGetSingleton<T>(out T)
    ComponentSystemBase.TryGetSingletonBuffer<T>(out DynamicBuffer<T>)
    ComponentSystemBase.SetSingleton<T>(T)
    ComponentSystemBase.GetSingletonEntity<T>()
    ComponentSystemBase.TryGetSingletonEntity<T>(out Entity)
    ComponentSystemBase.GetEntityQuery(params ComponentType[])
    ComponentSystemBase.GetEntityQuery(NativeArray<ComponentType>)
    ComponentSystemBase.GetEntityQuery(params EntityQueryDesc[])
    ComponentSystemBase.GetEntityQuery(in EntityQueryBuilder)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Physics.Authoring
    Assembly: Unity.Physics.Hybrid.dll
    Syntax
    public abstract class PhysicsDebugDisplaySystem : SystemBase

    Methods

    Arc(float3, float3, float3, float, ColorIndex)

    Draws an arc.

    Deprecated. Use Arc(float3, float3, float3, float, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Arc has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Arc instead.", true)]
    public static void Arc(float3 center, float3 normal, float3 arm, float angle, ColorIndex color)
    Parameters
    Type Name Description
    float3 center

    World space position of the arc center.

    float3 normal

    Arc normal.

    float3 arm

    Arc arm.

    float angle

    Arc angle.

    ColorIndex color

    Color.

    Arrow(float3, float3, ColorIndex)

    Draws an arrow.

    Deprecated. Use Arrow(float3, float3, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Arrow has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Arrow instead.", true)]
    public static void Arrow(float3 x, float3 v, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    World space position of the arrow base.

    float3 v

    Arrow direction with length.

    ColorIndex color

    Color.

    Box(float3, float3, quaternion, ColorIndex)

    Draws a box.

    Deprecated. Use Box(float3, float3, quaternion, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Box has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Box instead.", true)]
    public static void Box(float3 size, float3 center, quaternion orientation, ColorIndex color)
    Parameters
    Type Name Description
    float3 size

    Size of the box.

    float3 center

    Center of the box in world space.

    quaternion orientation

    Orientation of the box in world space.

    ColorIndex color

    Color.

    Cone(float3, float3, float, ColorIndex)

    Draws a cone.

    Deprecated. Use Cone(float3, float3, float, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Cone has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Cone instead.", true)]
    public static void Cone(float3 point, float3 axis, float angle, ColorIndex color)
    Parameters
    Type Name Description
    float3 point

    Point in world space.

    float3 axis

    Cone axis.

    float angle

    Cone angle.

    ColorIndex color

    Color.

    Line(float3, float3, ColorIndex)

    Draws a line between 2 points.

    Deprecated. Use Line(float3, float3, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Line has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Line instead.", true)]
    public static void Line(float3 x0, float3 x1, ColorIndex color)
    Parameters
    Type Name Description
    float3 x0

    Point 0 in world space.

    float3 x1

    Point 1 in world space.

    ColorIndex color

    Color.

    Lines(in NativeArray<float3>, ColorIndex)

    Draws multiple lines between the provided pairs of points.

    Deprecated. Use DebugDraw.Lines(NativeArray<float3>,ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Lines has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Lines instead.", true)]
    public static void Lines(in NativeArray<float3> lineVertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> lineVertices

    An array of vertices containing a sequence of point pairs. A line is drawn between every pair of points.

    ColorIndex color

    Color.

    Lines(in NativeList<float3>, ColorIndex)

    Draws multiple lines between the provided pairs of points.

    Deprecated. Use DebugDraw.Lines(NativeList<float3>,ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Lines has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Lines instead.", true)]
    public static void Lines(in NativeList<float3> lineVertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeList<float3> lineVertices

    A list of vertices containing a sequence of point pairs. A line is drawn between every pair of points.

    ColorIndex color

    Color.

    Lines(float3*, int, ColorIndex)

    Draws multiple lines between the provided pairs of points.

    Deprecated. Use Lines(float3*, int, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Lines has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Lines instead.", true)]
    public static void Lines(float3* lineVertices, int numVertices, ColorIndex color)
    Parameters
    Type Name Description
    float3* lineVertices

    A pointer to a vertices array containing a sequence of point pairs. A line is drawn between every pair of points.

    int numVertices

    Number of vertices.

    ColorIndex color

    Color.

    Plane(float3, float3, ColorIndex)

    Draws a plane.

    Deprecated. Use Plane(float3, float3, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Plane has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Plane instead.", true)]
    public static void Plane(float3 x, float3 v, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    Point in world space.

    float3 v

    Normal.

    ColorIndex color

    Color.

    Point(float3, float, ColorIndex)

    Draws a point.

    Deprecated. Use Point(float3, float, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Point has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Point instead.", true)]
    public static void Point(float3 x, float size, ColorIndex color)
    Parameters
    Type Name Description
    float3 x

    World space position.

    float size

    Extents.

    ColorIndex color

    Color.

    TriangleEdges(in NativeArray<float3>, in NativeArray<int>, ColorIndex)

    Draws multiple triangles from the provided data arrays.

    Deprecated. Use TriangleEdges(in NativeArray<float3>, in NativeArray<int>, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.TriangleEdges has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.TriangleEdges instead.", true)]
    public static void TriangleEdges(in NativeArray<float3> vertices, in NativeArray<int> triangleIndices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> vertices

    An array of vertices.

    NativeArray<int> triangleIndices

    An array of triangle indices pointing into the vertices array. A triangle is drawn from every triplet of triangle indices.

    ColorIndex color

    Color.

    Triangles(in NativeArray<float3>, in NativeArray<int>, ColorIndex)

    Draws multiple triangles from the provided data arrays.

    Deprecated. Use DebugDraw.Triangles(NativeArray<float3>, NativeArray<int>, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Triangles has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Triangles instead.", true)]
    public static void Triangles(in NativeArray<float3> vertices, in NativeArray<int> triangleIndices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> vertices

    An array of vertices.

    NativeArray<int> triangleIndices

    An array of triangle indices pointing into the vertices array. A triangle is drawn from every triplet of triangle indices.

    ColorIndex color

    Color.

    Triangles(in NativeArray<float3>, ColorIndex)

    Draws multiple triangles from the provided array of triplets of vertices.

    Deprecated. Use DebugDraw.Triangles(NativeArray<float3>, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Triangles has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Triangles instead.", true)]
    public static void Triangles(in NativeArray<float3> vertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeArray<float3> vertices

    An array containing a sequence of vertex triplets. A triangle is drawn from every triplet of vertices.

    ColorIndex color

    Color.

    Triangles(in NativeList<float3>, ColorIndex)

    Draws multiple triangles from the provided list of triplets of vertices.

    Deprecated. Use DebugDraw.Triangles(NativeList<float3>, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Triangles has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Triangles instead.", true)]
    public static void Triangles(in NativeList<float3> vertices, ColorIndex color)
    Parameters
    Type Name Description
    NativeList<float3> vertices

    A list containing a sequence of vertex triplets. A triangle is drawn from every triplet of vertices.

    ColorIndex color

    Color.

    Triangles(float3*, int, ColorIndex)

    Draws multiple triangles from the provided array of triplets of vertices.

    Deprecated. Use Triangles(float3*, int, ColorIndex) instead.

    Declaration
    [Obsolete("PhysicsDebugDisplaySystem.Triangles has been deprecated (RemovedAfter 2024-06-11). Use DebugDraw.Triangles instead.", true)]
    public static void Triangles(float3* vertices, int numVertices, ColorIndex color)
    Parameters
    Type Name Description
    float3* vertices

    An array containing a sequence of vertex triplets. A triangle is drawn from every triplet of vertices.

    int numVertices

    Number of vertices.

    ColorIndex color

    Color.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)