Skip to content

Instantly share code, notes, and snippets.

@SigmaThetaTech
Created December 4, 2020 20:04
Show Gist options
  • Save SigmaThetaTech/a45e57e63cf3af87f74371f548960cc9 to your computer and use it in GitHub Desktop.
Save SigmaThetaTech/a45e57e63cf3af87f74371f548960cc9 to your computer and use it in GitHub Desktop.
Creates a conical spiral in Roblox!
local CONE_HEIGHT = 10
local CONE_ANGLE = 30
local FREQUENCY = 10
local theta = math.rad(CONE_ANGLE)
function f(z)
z = -z
local newPosition = Vector3.new(
math.tan(theta) * z * math.cos(FREQUENCY * z),
math.tan(theta) * z * math.sin(FREQUENCY * z),
z
)
return newPosition
end
for i = 0, CONE_HEIGHT, 0.01 do
local newBrick = Instance.new("Part")
newBrick.Size = Vector3.new(0.1, 0.1, 0.1)
newBrick.Anchored = true
newBrick.BrickColor = BrickColor.Red()
newBrick.Position = f(i)
newBrick.Parent = game.Workspace
wait()
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment