Skip to content

Commit 2c8a69c

Browse files
committed
fix: Drawing
1 parent b7e211b commit 2c8a69c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/draw/src/Shared/Draw.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,25 @@ function Draw.direction(
106106
return Draw.ray(Ray.new(origin, direction), color, parent, diameter)
107107
end
108108

109+
--[=[
110+
Draws a shapecast
111+
]=]
112+
function Draw.shapecast(part: BasePart, origin: CFrameLike, direction: Vector3Like, color: Color3Like?)
113+
local castOrigin = assert(Draw._toCFrame(origin), "Bad origin")
114+
local castDirection = assert(Draw._toVector3(direction), "Bad direction")
115+
116+
local folder = Instance.new("Folder")
117+
folder.Name = "ShapeCast"
118+
folder.Archivable = false
119+
120+
for percent = 0, 1, 0.05 do
121+
local cframe = castOrigin + (castDirection * percent)
122+
Draw.part(part, cframe, color)
123+
end
124+
125+
return folder
126+
end
127+
109128
--[=[
110129
Draws a spherecast
111130

0 commit comments

Comments
 (0)