Hello peeps. I’m trying to create a Satellite that will rotate and I would like the player to stay on the satellite and match it’s movement wherever the player stands. I’m using scripts here no physics or welds.
I tried create a demo with one part using trig to update the players position, it works fine and they can stand anywhere but it breaks when the players tries to move, maybe this can be expanded on?
Demo script:
local spinPart = script.Parent
local hrp = workspace.Azarctic.HumanoidRootPart
local theta = math.rad(0.3)
while true do
wait()
spinPart.CFrame *= CFrame.Angles(0,theta,0)
local lv = spinPart.CFrame.LookVector
local p1 = spinPart.Position
local p2 = Vector3.new(hrp.Position.X,0,hrp.Position.Z)
local radius = (p2-Vector3.new(p1.X,0,p1.Z)).Magnitude
local opp,hyp = radius*math.sin(theta),radius*math.cos(theta)
local ratio = (radius*math.cos(theta))/radius
local p3 = p1 + ratio * (p2-p1)
p3v2 = Vector3.new(p3.X,hrp.Position.Y,p3.Z)
local p4 = p3v2 + opp*lv
hrp.Position = p4
end