I want objects to spawn anywhere in this circular area only how could i achieve this? Bc the only way i know how to do it is with a square or rectangle area
Drop a part on the workspace and add a Script to in and try this code out. Should give you an idea and you can just make a function out of it to compute X and Z when needed.
local part = script.Parent
while task.wait(.5) do
r = part.Size.Z*.5 * math.sqrt(math.random())
theta = math.random() * 2 * math.pi
x = part.Position.X + r * math.cos(theta)
z = part.Position.Z + r * math.sin(theta)
local part = Instance.new("Part")
part.Size = Vector3.new(.3, .3, .3)
part.Position = Vector3.new(x, 2, y)
part.Parent = workspace
part.Color = Color3.fromRGB(255,0,0)
part.Anchored = true
end
3 Likes
I mean, you can just add like 30 Spawn points on it lol, but if you want a easy script version ill give you one.