Im trying to make a turret system where the seat will follow the mouse rotation, however the mouse doesn't seem to make a full circle in degrees 0-360 instead it goes from 90 to -90. Im using a hinge so i have to convert the mouse pos to degrees. How would I prevent the mouse degrees from going negative and instead make it follow the 0-360
Code
local player = game:GetService("Players").LocalPlayer
local mouse = player:GetMouse()
local hinge = workspace.mover:WaitForChild("HingeConstraint")
local runService = game:GetService("RunService")
local mouseang
local degree
runService.RenderStepped:Connect(function()
mouseang = -math.asin((mouse.Hit.Position).Unit.X)
degree = math.deg(mouseang)
print(degree)
hinge.TargetAngle = degree
end)
Here is a video of whats happening
https://media.giphy.com/media/NTyexgTq6AZFpPdN9Y/giphy.gif
How would I make it so it goes around the back too?

2 comments
doesn't the Hinge have LimitsEnabled property enabled?
No I didn't enable limits