Show raw api
{
"functions": [
{
"name": "setColor",
"desc": "Sets the Draw's drawing color.",
"params": [
{
"name": "color",
"desc": "The color to set",
"lua_type": "Color3"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 40,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "resetColor",
"desc": "Resets the drawing color.",
"params": [],
"returns": [],
"function_type": "static",
"source": {
"line": 47,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "setRandomColor",
"desc": "Sets the Draw library to use a random color.",
"params": [],
"returns": [],
"function_type": "static",
"source": {
"line": 54,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "line",
"desc": "Draws a line between two points",
"params": [
{
"name": "start",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "finish",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "Optional",
"lua_type": "Color3"
},
{
"name": "parent",
"desc": "Optional",
"lua_type": "Instance?"
},
{
"name": "diameter",
"desc": "Optional",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Instance"
}
],
"function_type": "static",
"source": {
"line": 68,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "direction",
"desc": "Draws a line between directions",
"params": [
{
"name": "origin",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "direction",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "Optional",
"lua_type": "Color3"
},
{
"name": "parent",
"desc": "Optional",
"lua_type": "Instance?"
},
{
"name": "meshDiameter",
"desc": "Optional",
"lua_type": "number"
},
{
"name": "diameter",
"desc": "Optional",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Instance"
}
],
"function_type": "static",
"source": {
"line": 87,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "spherecast",
"desc": "Draws a spherecast\n\n:::tip\nUnlike WorldRoot:GetPartsInPart(), spherecast does not detect BaseParts\nthat initially intersect the shape. So this draw doesn't render that initial sphere.\n:::",
"params": [
{
"name": "origin",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "radius",
"desc": "",
"lua_type": "number"
},
{
"name": "direction",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "",
"lua_type": "Color3"
},
{
"name": "parent",
"desc": "",
"lua_type": "Parent"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 109,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "blockcast",
"desc": "Draws a block cast",
"params": [
{
"name": "cframe",
"desc": "",
"lua_type": "CFrame"
},
{
"name": "size",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "direction",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "",
"lua_type": "Color3"
},
{
"name": "parent",
"desc": "",
"lua_type": "Parent"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 137,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "raycast",
"desc": "Draws a raycast for debugging\n\n```lua\nDraw.raycast(origin, direction)\n```",
"params": [
{
"name": "origin",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "direction",
"desc": "",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "Optional",
"lua_type": "Color3"
},
{
"name": "parent",
"desc": "Optional",
"lua_type": "Instance?"
},
{
"name": "meshDiameter",
"desc": "Optional",
"lua_type": "number"
},
{
"name": "diameter",
"desc": "Optional",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "Instance"
}
],
"function_type": "static",
"source": {
"line": 266,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "ray",
"desc": "Draws a ray for debugging.\n\n```lua\nlocal ray = Ray.new(Vector3.new(0, 0, 0), Vector3.new(0, 10, 0))\nDraw.ray(ray)\n```",
"params": [
{
"name": "ray",
"desc": "",
"lua_type": "Ray"
},
{
"name": "color",
"desc": "Optional color to draw in",
"lua_type": "Color3?"
},
{
"name": "parent",
"desc": "Optional parent",
"lua_type": "Instance?"
},
{
"name": "diameter",
"desc": "Optional diameter",
"lua_type": "number?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 284,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "updateRay",
"desc": "Updates the rendered ray to the new color and position.\nUsed for certain scenarios when updating a ray on\nrenderstepped would impact performance, even in debug mode.\n\n```lua\nlocal ray = Ray.new(Vector3.new(0, 0, 0), Vector3.new(0, 10, 0))\nlocal drawn = Draw.ray(ray)\n\nRunService.RenderStepped:Connect(function()\n\tlocal newRay = Ray.new(Vector3.new(0, 0, 0), Vector3.new(0, 10*math.sin(os.clock()), 0))\n\tDraw.updateRay(drawn, newRay Color3.new(1, 0.5, 0.5))\nend)\n```",
"params": [
{
"name": "rayPart",
"desc": "Ray part",
"lua_type": "Instance"
},
{
"name": "ray",
"desc": "New ray",
"lua_type": "Ray"
},
{
"name": "color",
"desc": "New color",
"lua_type": "Color3"
},
{
"name": "diameter",
"desc": "Number",
"lua_type": "number"
}
],
"returns": [],
"function_type": "static",
"source": {
"line": 356,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "text",
"desc": "Render text in 3D for debugging. The text container will\nbe sized to fit the text.\n\n```lua\nDraw.text(Vector3.new(0, 10, 0), \"Point\")\n```",
"params": [
{
"name": "adornee",
"desc": "Adornee to rener on",
"lua_type": "Instance | Vector3"
},
{
"name": "text",
"desc": "Text to render",
"lua_type": "string"
},
{
"name": "color",
"desc": "Optional color to render",
"lua_type": "Color3?"
}
],
"returns": [
{
"desc": "",
"lua_type": "Instance"
}
],
"function_type": "static",
"source": {
"line": 396,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "sphere",
"desc": "Renders a sphere at the given point in 3D space.\n\n```lua\nDraw.sphere(Vector3.new(0, 10, 0), 10)\n```\n\nGreat for debugging explosions and stuff.",
"params": [
{
"name": "position",
"desc": "Position of the sphere",
"lua_type": "Vector3"
},
{
"name": "radius",
"desc": "Radius of the sphere",
"lua_type": "number"
},
{
"name": "color",
"desc": "Optional color",
"lua_type": "Color3?"
},
{
"name": "parent",
"desc": "Optional parent",
"lua_type": "Instance?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 504,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "point",
"desc": "Draws a point for debugging in 3D space.\n\n```lua\nDraw.point(Vector3.new(0, 25, 0), Color3.new(0.5, 1, 0.5))\n```",
"params": [
{
"name": "position",
"desc": "Point to Draw",
"lua_type": "Vector3 | CFrame"
},
{
"name": "color",
"desc": "Optional color",
"lua_type": "Color3?"
},
{
"name": "parent",
"desc": "Optional parent",
"lua_type": "Instance?"
},
{
"name": "diameter",
"desc": "Optional diameter",
"lua_type": "number?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 521,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "labelledPoint",
"desc": "Renders a point with a label in 3D space.\n\n```lua\nDraw.labelledPoint(Vector3.new(0, 10, 0), \"AI target\")\n```",
"params": [
{
"name": "position",
"desc": "Position to render",
"lua_type": "Vector3 | CFrame"
},
{
"name": "label",
"desc": "Label to render on the point",
"lua_type": "string"
},
{
"name": "color",
"desc": "Optional color",
"lua_type": "Color3?"
},
{
"name": "parent",
"desc": "Optional parent",
"lua_type": "Instance?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 573,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "cframe",
"desc": "Renders a CFrame in 3D space. Includes each axis.\n\n```lua\nDraw.cframe(CFrame.Angles(0, math.pi/8, 0))\n```",
"params": [
{
"name": "cframe",
"desc": "",
"lua_type": "CFrame"
}
],
"returns": [
{
"desc": "",
"lua_type": "Model"
}
],
"function_type": "static",
"source": {
"line": 594,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "part",
"desc": "Draws a part in 3D space\n\n```lua\nDraw.part(part, Color3.new(1, 1, 1))\n```",
"params": [
{
"name": "template",
"desc": "",
"lua_type": "BasePart"
},
{
"name": "cframe",
"desc": "",
"lua_type": "CFrame"
},
{
"name": "color",
"desc": "",
"lua_type": "Color3?"
},
{
"name": "transparency",
"desc": "",
"lua_type": "number"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 639,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "box",
"desc": "Renders a box in 3D space. Great for debugging bounding boxes.\n\n```lua\nDraw.box(Vector3.new(0, 5, 0), Vector3.new(10, 10, 10))\n```",
"params": [
{
"name": "cframe",
"desc": "CFrame of the box",
"lua_type": "CFrame | Vector3"
},
{
"name": "size",
"desc": "Size of the box",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "Optional Color3",
"lua_type": "Color3"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 698,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "region3",
"desc": "Renders a region3 in 3D space.\n\n```lua\nDraw.region3(Region3.new(Vector3.new(0, 0, 0), Vector3.new(10, 10, 10)))\n```",
"params": [
{
"name": "region3",
"desc": "Region3 to render",
"lua_type": "Region3"
},
{
"name": "color",
"desc": "Optional color3",
"lua_type": "Color3?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 749,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "terrainCell",
"desc": "Renders a terrain cell in 3D space. Snaps the position\nto the nearest position.\n\n```lua\nDraw.terrainCell(Vector3.new(0, 0, 0))\n```",
"params": [
{
"name": "position",
"desc": "World space position",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "Optional color to render",
"lua_type": "Color3?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 767,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "vector",
"desc": "Draws a vector in 3D space.\n\n```lua\nDraw.vector(Vector3.new(0, 0, 0), Vector3.new(0, 1, 0))\n```",
"params": [
{
"name": "position",
"desc": "Position of the vector",
"lua_type": "Vector3"
},
{
"name": "direction",
"desc": "Direction of the vector. Determines length.",
"lua_type": "Vector3"
},
{
"name": "color",
"desc": "Optional color",
"lua_type": "Color3?"
},
{
"name": "parent",
"desc": "Optional instance",
"lua_type": "Instance?"
},
{
"name": "meshDiameter",
"desc": "Optional diameter",
"lua_type": "number?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 857,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "ring",
"desc": "Draws a ring in 3D space.\n\n```lua\nDraw.ring(Vector3.new(0, 0, 0), Vector3.new(0, 1, 0), 10)\n```",
"params": [
{
"name": "ringPos",
"desc": "Position of the center of the ring",
"lua_type": "Vector3"
},
{
"name": "ringNorm",
"desc": "Direction of the ring.",
"lua_type": "Vector3"
},
{
"name": "ringRadius",
"desc": "Optional radius for the ring",
"lua_type": "number?"
},
{
"name": "color",
"desc": "Optional color",
"lua_type": "Color3?"
},
{
"name": "parent",
"desc": "Optional instance",
"lua_type": "Instance?"
}
],
"returns": [
{
"desc": "",
"lua_type": "BasePart"
}
],
"function_type": "static",
"source": {
"line": 879,
"path": "src/draw/src/Shared/Draw.lua"
}
},
{
"name": "getDefaultParent",
"desc": "Retrieves the default parent for the current execution context.",
"params": [],
"returns": [
{
"desc": "",
"lua_type": "Instance"
}
],
"function_type": "static",
"source": {
"line": 976,
"path": "src/draw/src/Shared/Draw.lua"
}
}
],
"properties": [],
"types": [],
"name": "Draw",
"desc": "Debug drawing library useful for debugging 3D abstractions. One of\nthe more useful utility libraries.\n\nThese functions are incredibly easy to invoke for quick debugging.\nThis can make debugging any sort of 3D geometry really easy.\n\n```lua\n-- A sample of a few API uses\nDraw.point(Vector3.new(0, 0, 0))\nDraw.terrainCell(Vector3.new(0, 0, 0))\nDraw.cframe(CFrame.new(0, 10, 0))\nDraw.text(Vector3.new(0, -10, 0), \"Testing!\")\n```\n\n:::tip\nThis library should not be used to render things in production for\nnormal players, as it is optimized for debug experience over performance.\n:::",
"source": {
"line": 23,
"path": "src/draw/src/Shared/Draw.lua"
}
}