🐛 Debug
Debugging tools: profiling for scripts, and drawing Debug shapes in the world
🗿 Static Functions
DrawBox | Draws a Debug box in the world | |
DrawCapsule | Draws a Debug capsule in the World | |
DrawCoordinateSystem | Draws a Debug coordinate system in the world | |
DrawCrosshairs | Draws a Debug crosshair in the world | |
DrawCylinder | Draws a Debug cylinder in the world | |
DrawDirectionalArrow | Draws a Debug directional arrow in the world | |
DrawLine | Draws a Debug Line in the World | |
DrawPoint | Draws a Debug Point in the World | |
DrawSphere | Draws a Debug sphere in the World | |
DrawString | Draws a Debug string in the world | |
IsProfilerConnected: boolean | Returns if a Tracy profiler is connected right now. Useful for skipping debugging logic | |
ProfileMessage | Marks an event with a text in the Tracy timeline | |
ProfilePlot | Records a value in a graph in Tracy | |
ProfileZone | Runs a function and measures it as a zone in Tracy and in the native profiling |

DrawBoxModerate
Draws a Debug box in the world
Debug.DrawBox(location, extent, rotation, color, life_time?, thickness?)

DrawCapsuleModerate
Draws a Debug capsule in the World
Debug.DrawCapsule(center, half_height, radius, rotation, color?, life_time?, thickness?)
Parameters
| Name | Type | Descrição |
|---|---|---|
center | Vector | Center of the capsule |
half_height | float | Half of the capsule height |
radius | float | Radius of the capsule |
rotation | Rotator | Rotation of the capsule |
color? | Color | The color to use Default Color.RED |
life_time? | float | Seconds before the debug drawing disappears Default 5 |
thickness? | float | Line thickness Default 0 |

DrawCoordinateSystemModerate
Draws a Debug coordinate system in the world
Debug.DrawCoordinateSystem(location, rotation, size?, life_time?, thickness?)

DrawCrosshairsModerate
Draws a Debug crosshair in the world
Debug.DrawCrosshairs(location, rotation, size?, color?, life_time?, thickness?)

DrawCylinderModerate
Draws a Debug cylinder in the world
Debug.DrawCylinder(start_location, end_location, radius, segments, color?, life_time?, thickness?)
Parameters
| Name | Type | Descrição |
|---|---|---|
start_location | Vector | World start location |
end_location | Vector | World end location |
radius | float | Radius |
segments | integer | Number of segments used to draw it, more segments look smoother |
color? | Color | The color to use Default Color.RED |
life_time? | float | Seconds before the drawing disappears Default 5 |
thickness? | float | Line thickness Default 0 |

DrawDirectionalArrowModerate
Draws a Debug directional arrow in the world
Debug.DrawDirectionalArrow(start_location, end_location, arrow_size?, color?, life_time?, thickness?)
Parameters
| Name | Type | Descrição |
|---|---|---|
start_location | Vector | World start location |
end_location | Vector | World end location |
arrow_size? | float | Size of the arrow head Default 100 |
color? | Color | The color to use Default Color.RED |
life_time? | float | Seconds before the drawing disappears Default 5 |
thickness? | float | Line thickness Default 0 |

DrawLineModerate
Draws a Debug Line in the World
Debug.DrawLine(start_position, end_position, color?, life_time?, thickness?)

DrawPointModerate
Draws a Debug Point in the World
Debug.DrawPoint(start_position, color?, life_time?, size?)

DrawSphereModerate
Draws a Debug sphere in the World
Debug.DrawSphere(start_location, radius, segments, color?, life_time?, thickness?)
Parameters
| Name | Type | Descrição |
|---|---|---|
start_location | Vector | World start location |
radius | float | Radius |
segments | integer | Number of segments used to draw it, more segments look smoother |
color? | Color | The color to use Default Color.RED |
life_time? | float | Seconds before the drawing disappears Default 5 |
thickness? | float | Line thickness Default 0 |

DrawStringModerate
Draws a Debug string in the world
Debug.DrawString(location, text, color?, life_time?, draw_shadow?, font_scale?)
Parameters
| Name | Type | Descrição |
|---|---|---|
location | Vector | World location |
text | string | The text to draw |
color? | Color | The color to use Default Color.RED |
life_time? | float | Seconds before the drawing disappears Default 5 |
draw_shadow? | boolean | Whether to draw a shadow behind the text Default false |
font_scale? | float | Scale of the text Default 1 |

IsProfilerConnectedOptimal
Returns if a Tracy profiler is connected right now. Useful for skipping debugging logic
local ret = Debug.IsProfilerConnected()
Returns
| Type | Descrição |
|---|---|
| boolean | If Tracy is connected |

ProfileMessageOptimal
Marks an event with a text in the Tracy timeline
The text is prefixed with '[package]'. Does nothing while Tracy is not connected
Debug.ProfileMessage(text)
Parameters
| Name | Type | Descrição |
|---|---|---|
text | string | Text of the event |

ProfilePlotOptimal
Records a value in a graph in Tracy
The graph is named '[package] name'. Use fixed names: each different name stays stored until the game or server closes, up to 256 names in total. Does nothing while Tracy is not connected
Debug.ProfilePlot(name, value)

ProfileZoneOptimal
Runs a function and measures it as a zone in Tracy and in the native profiling
The zone is named '[package] name' and always closes when the function returns.
Use fixed names: each different name stays stored until the game or server closes, up to 256 names in total
Debug.ProfileZone(name, callback)
🚀 Events
This class doesn't have own events.

