I’m working on the mechanics for a spell that calls for an expanding fire ring. Here’s what I have thus far code wise:
local attach = {}
local angleStep = 3
local part = Instance.new("Part")
part.Shape = Enum.PartType.Block
part.Transparency = 0
part.Anchored = true
part.CanCollide = false
part.Position = Vector3.new(0, 0.5, 0)
part.Size = Vector3.new(1, 1, 1)
part.Parent = game.Workspace
task.wait(10)
local function setOffset(angle, radius)
local radian = math.rad(angle)
local x = math.sin(radian) * radius
local y = part.Position.Y
local z = math.cos(radian) * radius
return Vector3.new(x, y, z)
end
for i = 0, 359, angleStep do
local attachment = Instance.new("Attachment")
attachment.Position = setOffset(i, 2)
attachment.Parent = part
local fire = Instance.new("Fire")
fire.Size = 10
fire.Heat = 10
fire.Parent = attachment
table.insert(attach, attachment)
end
for i = 3, 30, 1 do
task.wait(0.06)
local angle = 0
for _, at in ipairs(attach) do
at.Position = setOffset(angle, i)
angle += angleStep
end
end
task.wait(20)
part:Destroy()
As the ring expands to larger distances from the center, the fires spread out from each other. There’s also uneven gaps between the fires. Any suggestions on how to improve this? I have tried setting the gap to 5° and the fires are closer together, but it’s not the wall of fire that I’m trying to achieve.
EDIT: I found some errors in the script and corrected them. The weird gaps have been fixed but the rest of it…any ideas?