What do you want to achieve?
The part to go in a circle correctly
What is the issue?
The part goes to exactly origin (0,0,0) and goes in a circle there (my script never tells it to intentionally)
What solutions have you tried so far?
There’s not much info on doing things like this given by ROBLOX.
task.wait(5)
local degree = 0
while task.wait(0.01) do
degree += 1
local x = math.cos(math.rad(degree))
local y = math.sin(math.rad(degree))
local z = 1
workspace.Planet.Position = Vector3.new(x, y, z)
end
task.wait(5)
local degree = 0
while task.wait(0.01) do
degree += 1
local x = math.cos(math.rad(degree))
local y = math.sin(math.rad(degree))
local z = 1
workspace.Planet.Position += Vector3.new(x, y, z) --// Changed = to +=
end
local range = 10
while task.wait(0.01) do
local now = os.clock()
local x = math.cos(now) * range
local y = math.sin(now) * range
local z = 1
workspace.Planet.Position = Vector3.new(x, y, z)
end
The script is setting the planet’s position to a completely new position instead of adding on to the original position.
What you would have to do is save the planet’s position in a variable before hand in this case.
task.wait(5)
local OriginalPosition = workspace.Planet.Position
local degree = 0
while task.wait(0.01) do
degree += 1
local x = math.cos(math.rad(degree))
local y = math.sin(math.rad(degree))
local z = 1
workspace.Planet.Position = OriginalPosition + Vector3.new(x, y, z)
end