I’m just trying to make my planets orbit the Sun. Pretty simple, right?
Well, as usual, I’ve found a way to take something that should be simple and make it unnecessarily complicated. For some reason, my planet seems to completely ignore distance
and instead stays in the center of the Sun:
local i = 0
local dist = des[x].Distance.Value --How far the planet is from the star.
local spd = des[x].Speed.Value --How fast the planet orbits.
local angle = 90--des[i].Angle.Value --how far the planet is tilted in its orbit.
while true do
i=i+1
wait()
des[x]:SetPrimaryPartCFrame(point*CFrame.fromEulerAnglesXYZ(angle,i*spd,0)*CFrame.new(0,0,dist * 10000))
end
(des[x]
is the planet and point
is the Sun)
As you can tell, I’ve tried multiplying the distance by ungodly amounts to no avail. It’s like my math is completely ignoring distance altogether. Does anyone see something I’m doing wrong?