To elaborate more, I'm working on a fighter jet and I'd like to find how to make sure the mouse can't move out of a small circle in the centre of the screen (hopefully you see what I mean)
Any solutions would be helpful!
To elaborate more, I'm working on a fighter jet and I'd like to find how to make sure the mouse can't move out of a small circle in the centre of the screen (hopefully you see what I mean)
Any solutions would be helpful!
this will only show the moving box or circle
local Uis = game:GetService("UserInputService")
local RunS = game:GetService("RunService")
local Frame = script.Parent.Frame
local Sensitivity = 1 --above one for more sensitivity i think
RunS.Stepped:Connect(function()
Uis.MouseBehavior = Enum.MouseBehavior.LockCenter
Uis.MouseIconEnabled = false
local Delta = Uis:GetMouseDelta()
Uis.MouseDeltaSensitivity = Sensitivity
--script.Parent.Frame.Position = UDim2.new(.5,-Delta.X,.5,-Delta.Y)
game:GetService("TweenService"):Create(Frame,TweenInfo.new(.1),{Position = UDim2.new(.5,-Delta.X,.5,-Delta.Y)}):Play()
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
thanks, i'll test it out