Hi, I’m trying to create a navigation sphere for my rocket building game.
The problem:
The blue ball is supposed to rotate with the blue ring:
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")
local Model = Workspace.Test
local Root = Model.Root
local BlueRing = Model.Blue
local YellowRing = Model.Yellow
local BluePointer = Model.BluePointer
local YellowPointer = Model.YellowPointer
local R = 2
local Amount = 0
local function Update()
Amount = Amount + 1
YellowPointer.CFrame = CFrame.new(Root.Position) * CFrame.Angles(0, math.rad(Amount), 0) * CFrame.new(0, 0, R)
BlueRing.CFrame = CFrame.new(Root.Position, YellowPointer.Position) * CFrame.Angles(0, 0, math.rad(90))
BluePointer.CFrame = CFrame.new(Root.Position) * CFrame.Angles(0, 0, math.rad(Amount)) * CFrame.new(0, R, 0)
local GyroCFrame = CFrame.new(Root.Position, BluePointer.Position)
end
RunService.Heartbeat:Connect(Update)