I’m trying to work on a decent Hyperspace / Star entrance effect similar to this one:
Currently this is where I’m at:
My question is how can I decently create Star parts that are fairly spaced on the Players screen rather than being clumped together?
The way I do it is by using a Circle generator that randomly generates a part based on Math.Random; it’s extremely ineffective though:
local Parts = 20
local Radius = 40
local Offset = 40
Create_Part = function(Num)
print(Parts)
local isRandom = math.random(1, 5)
if isRandom == 3 then
local Origin = Vector3.new(0, 0, 0)
local AT0 = Instance.new("Attachment", Jupiter3["Base"])
AT0.Name = "AT0"
--AT0.Visible = true
local AT1 = Instance.new("Attachment", Jupiter3["Base"])
AT1.Name = "AT1"
-- AT1.Visible = true
local Beam_Clone = script:WaitForChild("Beam"):Clone()
Beam_Clone.Parent = Jupiter3["Base"]
Beam_Clone.Attachment0 = AT0
Beam_Clone.Attachment1 = AT1
local v1 = Num * ((math.pi * 2) / Parts)
local X, Y, Z
X = Radius * math.sin(v1)
Y = Radius * math.cos(v1)
Z = Offset
local v2 = Vector3.new(X, Y, Z)
AT0.Position = Origin + v2 - Vector3.new(0, 0, 200)
AT1.Position = Origin + v2 - Vector3.new(0, 0, 200)
end
end
for i = 1,25 do
for i = 1, Parts do
Create_Part(i)
end
Parts += 5
Radius += 10
Offset += 10
end