How to make a compass through GUI?
I don’t want to make the compass move in the game world, I want it moving using UserInputService
If you want to know what compass is:
The problem was that arrow wasn’t moving correctly:
local Service = game:GetService('UserInputService')
local Run = game:GetService('RunService')
game:GetService('StarterGui'):SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
if Service.GyroscopeEnabled then
Service.DeviceRotationChanged:Connect(function(input, cframe)
local lookVector = cframe.LookVector
script.Parent.Background.Arrow.Rotation = math.deg(math.atan2(lookVector.X, lookVector.Z))
end)
else
Instance.new('ColorCorrectionEffect', workspace.CurrentCamera).TintColor = Color3.new(0, 0, 0)
end
if Service.VREnabled then
spawn(function()
while true do
Run.Stepped:Wait()
local cframe = Service:GetUserCFrame(Enum.UserCFrame.RightHand)
local lookVector = cframe.LookVector
script.Parent.Background.Arrow.Rotation = math.deg(math.atan2(lookVector.X, lookVector.Z))
end
end)
else
Instance.new('ColorCorrectionEffect', workspace.CurrentCamera).TintColor = Color3.new(0, 0, 0)
end
Any scripts will help!