Fe Hat Orbit Script -
-- ModuleScript: HatOrbitController local HatOrbitController = {} function HatOrbitController.startOrbit(hatHandle, targetPart, radius, speed, heightOffset) local angle = 0 local connection
local function orbitUpdate() angle = angle + speed * tick() local x = math.cos(angle) * radius local z = math.sin(angle) * radius local relativeCF = CFrame.new(x, heightOffset, z) hatHandle.CFrame = targetPart.CFrame * relativeCF end
local y = heightOffset + math.sin(angle * 2) * 0.5 Store hats in a table and assign each a phase offset: FE Hat Orbit Script
connection = game:GetService("RunService").RenderStepped:Connect(orbitUpdate) return connection -- to disconnect later end
local relativePos = Vector3.new(x, y, z) local newCFrame = head.CFrame + head.CFrame:VectorToWorldSpace(relativePos) but could be elliptical
local angle = startAngle local lastUpdate = os.clock()
angle = angle + speed * dt if angle > math.pi * 2 then angle = angle - math.pi * 2 end FE Hat Orbit Script
-- Compute orbit position relative to head local x = math.cos(angle) * radius local z = math.sin(angle) * radius local y = heightOffset -- flat orbit, but could be elliptical