The DebugOverlay
property provides access to the DebugOverlaySystem
, which allows for the drawing of temporary debug shapes and text within the scene. This can be useful for visualizing data or debugging gameplay elements during development.
The DebugOverlay
property provides access to the DebugOverlaySystem
, which allows for the drawing of temporary debug shapes and text within the scene. This can be useful for visualizing data or debugging gameplay elements during development.
To use the DebugOverlay
property, you can access it from any component that inherits from Sandbox.Component
. This property is not static, so it must be accessed through an instance of a component.
// Example of using DebugOverlay to draw a line in the scene public class MyComponent : Component { public override void OnComponentUpdate() { // Draw a line from (0, 0, 0) to (10, 10, 10) with a red color DebugOverlay.Line(Vector3.Zero, new Vector3(10, 10, 10), Color.Red); } }