Ir para o conteúdo principal
Version: latest - a1.172.0 ⚖️

🐛 Debug

Debugging tools: profiling for scripts, and drawing Debug shapes in the world

🗿Static ClassClient & Server🧑‍💻API Source

🗿 Static Functions​

DrawBoxDraws a Debug box in the world
DrawCapsuleDraws a Debug capsule in the World
DrawCoordinateSystemDraws a Debug coordinate system in the world
DrawCrosshairsDraws a Debug crosshair in the world
DrawCylinderDraws a Debug cylinder in the world
DrawDirectionalArrowDraws a Debug directional arrow in the world
DrawLineDraws a Debug Line in the World
DrawPointDraws a Debug Point in the World
DrawSphereDraws a Debug sphere in the World
DrawStringDraws a Debug string in the world
IsProfilerConnected: booleanReturns if a Tracy profiler is connected right now. Useful for skipping debugging logic
ProfileMessageMarks an event with a text in the Tracy timeline
ProfilePlotRecords a value in a graph in Tracy
ProfileZoneRuns 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?)
Parameters
NameTypeDescrição
locationVectorWorld location
extentVectorHalf size of the box on each axis
rotationRotatorWorld rotation
colorColorThe color to use
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawCapsuleModerate​

Draws a Debug capsule in the World

Debug.DrawCapsule(center, half_height, radius, rotation, color?, life_time?, thickness?)
Parameters
NameTypeDescrição
centerVectorCenter of the capsule
half_heightfloatHalf of the capsule height
radiusfloatRadius of the capsule
rotationRotatorRotation of the capsule
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the debug drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawCoordinateSystemModerate​

Draws a Debug coordinate system in the world

Debug.DrawCoordinateSystem(location, rotation, size?, life_time?, thickness?)
Parameters
NameTypeDescrição
locationVectorWorld location
rotationRotatorWorld rotation
size?floatSize of the drawing Default 100
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawCrosshairsModerate​

Draws a Debug crosshair in the world

Debug.DrawCrosshairs(location, rotation, size?, color?, life_time?, thickness?)
Parameters
NameTypeDescrição
locationVectorWorld location
rotationRotatorWorld rotation
size?floatSize of the drawing Default 100
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawCylinderModerate​

Draws a Debug cylinder in the world

Debug.DrawCylinder(start_location, end_location, radius, segments, color?, life_time?, thickness?)
Parameters
NameTypeDescrição
start_locationVectorWorld start location
end_locationVectorWorld end location
radiusfloatRadius
segmentsintegerNumber of segments used to draw it, more segments look smoother
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine 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
NameTypeDescrição
start_locationVectorWorld start location
end_locationVectorWorld end location
arrow_size?floatSize of the arrow head Default 100
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawLineModerate​

Draws a Debug Line in the World

Debug.DrawLine(start_position, end_position, color?, life_time?, thickness?)
Parameters
NameTypeDescrição
start_positionVectorWorld start location
end_positionVectorWorld end location
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawPointModerate​

Draws a Debug Point in the World

Debug.DrawPoint(start_position, color?, life_time?, size?)
Parameters
NameTypeDescrição
start_positionVectorWorld start location
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
size?floatSize of the drawing Default 10

DrawSphereModerate​

Draws a Debug sphere in the World

Debug.DrawSphere(start_location, radius, segments, color?, life_time?, thickness?)
Parameters
NameTypeDescrição
start_locationVectorWorld start location
radiusfloatRadius
segmentsintegerNumber of segments used to draw it, more segments look smoother
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
thickness?floatLine thickness Default 0

DrawStringModerate​

Draws a Debug string in the world

Debug.DrawString(location, text, color?, life_time?, draw_shadow?, font_scale?)
Parameters
NameTypeDescrição
locationVectorWorld location
textstringThe text to draw
color?ColorThe color to use Default Color.RED
life_time?floatSeconds before the drawing disappears Default 5
draw_shadow?booleanWhether to draw a shadow behind the text Default false
font_scale?floatScale 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
TypeDescrição
booleanIf 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
NameTypeDescrição
textstringText 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)
Parameters
NameTypeDescrição
namestringName of the graph
valuenumberValue to record

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)
Parameters
NameTypeDescrição
namestringName of the zone
callbackfunctionFunction to run and measure

🚀 Events​

This class doesn't have own events.