Last active
July 8, 2023 06:22
-
-
Save evaera/735f23c67c2c173cfed2955f357b03a3 to your computer and use it in GitHub Desktop.
Revisions
-
evaera revised this gist
Oct 21, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,8 @@ Quick and dirty. You probably want this for debugging, so just slap this function in wherever you want it. Minified and full versions are included below. Pick one! ## Usage Call the arrow function to create an arrow in workspace. If you call the function twice with the same name, the second call will replace & reuse the original. This works well when calling from within a Heartbeat event listener to update the arrow every frame. -
evaera revised this gist
Oct 21, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ local function arrow(b,c,d,e,f)e=e or BrickColor.random().Color;f=f or 1;if typeof(c)=="Instance"then if c:IsA("BasePart")then c=c.CFrame elseif c:IsA("Attachment")then c=c.WorldCFrame end;if d~=nil then c=c.p end end;if typeof(d)=="Instance"then if d:IsA("BasePart")then d=d.Position elseif d:IsA("Attachment")then d=d.WorldPosition end end;if typeof(c)=="CFrame"and d==nil then local g=c.lookVector;d=c.p;c=d+g*-10 end;if d==nil then d=c;c=d+Vector3.new(0,10,0)end;assert(typeof(c)=="Vector3"and typeof(d)=="Vector3","Passed parameters are of invalid types")local h=workspace:FindFirstChild("Arrows")or Instance.new("Folder")h.Name="Arrows"h.Parent=workspace;local i=h:FindFirstChild(b.."_shaft")or Instance.new("CylinderHandleAdornment")i.Height=(c-d).magnitude-2;i.CFrame=CFrame.lookAt((c+d)/2-(d-c).unit*1,d)if i.Parent==nil then i.Name=b.."_shaft"i.Color3=e;i.Radius=0.15;i.Adornee=workspace.Terrain;i.Transparency=0;i.Radius=0.15*f;i.Transparency=0;i.AlwaysOnTop=true;i.ZIndex=5-math.ceil(f)end;i.Parent=h;local j=h:FindFirstChild(b.."_head")or Instance.new("ConeHandleAdornment")f=f==1 and 1 or 1.4;if j.Parent==nil then j.Name=b.."_head"j.Color3=e;j.Radius=0.5*f;j.Transparency=0;j.Adornee=workspace.Terrain;j.Height=2*f;j.AlwaysOnTop=true;j.ZIndex=5-math.ceil(f)end;j.CFrame=CFrame.lookAt((CFrame.lookAt(d,c)*CFrame.new(0,0,-2-(f-1)/2)).p,d)j.Parent=h;if f==1 then arrow(b.."_backdrop",c,d,Color3.new(0,0,0),2)end end -
evaera revised this gist
Oct 21, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ # Roblox Arrows for 3D Visualizations  ## Installation -
evaera revised this gist
Oct 21, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Roblox Arrows for 3D Visualizations  ## Installation -
evaera revised this gist
Oct 21, 2020 . 2 changed files with 14 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Roblox Arrows for 3D Visualizations  ## Installation This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ local function arrow(name, from, to, color, scale) color = color or BrickColor.random().Color scale = scale or 1 if typeof(from) == "Instance" then if from:IsA("BasePart") then @@ -36,11 +36,11 @@ local function arrow(name, from, to, color, scale) assert(typeof(from) == "Vector3" and typeof(to) == "Vector3", "Passed parameters are of invalid types") local container = workspace:FindFirstChild("Arrows") or Instance.new("Folder") container.Name = "Arrows" container.Parent = workspace local shaft = container:FindFirstChild(name .. "_shaft") or Instance.new("CylinderHandleAdornment") shaft.Height = (from - to).magnitude - 2 @@ -63,9 +63,9 @@ local function arrow(name, from, to, color, scale) shaft.Parent = container local pointy = container:FindFirstChild(name .. "_head") or Instance.new("ConeHandleAdornment") scale = scale == 1 and 1 or 1.4 if pointy.Parent == nil then pointy.Name = name .. "_head" @@ -80,9 +80,9 @@ local function arrow(name, from, to, color, scale) pointy.CFrame = CFrame.lookAt((CFrame.lookAt(to, from) * CFrame.new(0, 0, -2 - ((scale-1)/2))).p, to) pointy.Parent = container if scale == 1 then arrow(name .. "_backdrop", from, to, Color3.new(0, 0, 0), 2) end end -
evaera revised this gist
Oct 21, 2020 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,15 @@ # Roblox Arrows for 3D Visualizations <img src="https://i.eryn.io/2043/a097a82129d5.gif" /> ## Installation Quick and dirty. You probably want this for debugging, so just slap this function in wherever you want it. ## Usage Call the arrow function to create an arrow in workspace. If you call the function twice with the same name, the second call will replace & reuse the original. This works well when calling from within a Heartbeat event listener to update the arrow every frame. - `arrow(name: string, from: Vector3, to: Vector3)` -> Creates an arrow between `from` and `to` - `arrow(name: string, point: Vector3)` -> Creates an arrow pointing at `point` - `arrow(name: string, cframe: CFrame)` -> Creates an arrow with its point at the CFrame position facing the CFrame LookVector -
evaera revised this gist
Oct 21, 2020 . 1 changed file with 6 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,12 @@ # Roblox Arrows for 3D Visualizations <img src="https://i.eryn.io/2043/ezgif-3-a01c101b9831.gif" /> ## Usage - `arrow(name: string, from: Vector3, to: Vector3)` -> Creates an arrow between `from` and `to` - `arrow(name: string, point: Vector3)` -> Creates an arrow pointing at `point` - `arrow(name: string, cframe: CFrame)` -> Creates an arrow with its point at the CFrame position facing the CFrame LookVector - `arrow(name: string, part: BasePart)` -> Arrow represents the Part's CFrame - `arrow(name: string, fromPart: BasePart, toPart: BasePart)` -> Arrow between the two parts -
evaera revised this gist
Oct 21, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,8 @@ # Roblox Arrows for 3D Visualizations <img src="https://i.eryn.io/2043/y1xBLRlo.gif" /> <img src="https://i.eryn.io/2043/ezgif-3-d6972d3dac19.gif" /> ## Usage -
evaera renamed this gist
Oct 21, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
evaera revised this gist
Oct 21, 2020 . 2 changed files with 2 additions and 2 deletions.There are no files selected for viewing
File renamed without changes.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ # Roblox Arrows for 3D Visualizations <img src="https://i.eryn.io/2043/y1xBLRlo.gif" /> <img src="https://i.eryn.io/2043/AF1OgkOX.gif" /> ## Usage -
evaera created this gist
Oct 21, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,88 @@ local function arrow(name, from, to, color, scale) color = color or BrickColor.random().Color scale = scale or 1 if typeof(from) == "Instance" then if from:IsA("BasePart") then from = from.CFrame elseif from:IsA("Attachment") then from = from.WorldCFrame end if to ~= nil then from = from.p end end if typeof(to) == "Instance" then if to:IsA("BasePart") then to = to.Position elseif to:IsA("Attachment") then to = to.WorldPosition end end if typeof(from) == "CFrame" and to == nil then local look = from.lookVector to = from.p from = to + (look * -10) end if to == nil then to = from from = to + Vector3.new(0, 10, 0) end assert(typeof(from) == "Vector3" and typeof(to) == "Vector3", "Passed parameters are of invalid types") local container = workspace:FindFirstChild("Arrows") or Instance.new("Folder") container.Name = "Arrows" container.Parent = workspace local shaft = container:FindFirstChild(name .. "_shaft") or Instance.new("CylinderHandleAdornment") shaft.Height = (from - to).magnitude - 2 shaft.CFrame = CFrame.lookAt( ((from + to)/2) - ((to - from).unit * 1), to ) if shaft.Parent == nil then shaft.Name = name .. "_shaft" shaft.Color3 = color shaft.Radius = 0.15 shaft.Adornee = workspace.Terrain shaft.Transparency = 0 shaft.Radius = 0.15 * scale shaft.Transparency = 0 shaft.AlwaysOnTop = true shaft.ZIndex = 5 - math.ceil(scale) end shaft.Parent = container local pointy = container:FindFirstChild(name .. "_head") or Instance.new("ConeHandleAdornment") scale = scale == 1 and 1 or 1.4 if pointy.Parent == nil then pointy.Name = name .. "_head" pointy.Color3 = color pointy.Radius = 0.5 * scale pointy.Transparency = 0 pointy.Adornee = workspace.Terrain pointy.Height = 2 * scale pointy.AlwaysOnTop = true pointy.ZIndex = 5 - math.ceil(scale) end pointy.CFrame = CFrame.lookAt((CFrame.lookAt(to, from) * CFrame.new(0, 0, -2 - ((scale-1)/2))).p, to) pointy.Parent = container if scale == 1 then arrow(name .. "_backdrop", from, to, Color3.new(0, 0, 0), 2) end end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ # Roblox Arrows for 3D Visualizations   ## Usage `arrow(name: string, from: Vector3, to: Vector3)` -> Creates an arrow between `from` and `to` `arrow(name: string, point: Vector3)` -> Creates an arrow pointing at `point` `arrow(name: string, cframe: CFrame)` -> Creates an arrow with its point at the CFrame position facing the CFrame LookVector `arrow(name: string, part: BasePart)` -> Arrow represents the Part's CFrame `arrow(name: string, fromPart: BasePart, toPart: BasePart)` -> Arrow between the two parts