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
01 | local Uis = game:GetService( "UserInputService" ) |
02 | local RunS = game:GetService( "RunService" ) |
03 | local Frame = script.Parent.Frame |
04 | local Sensitivity = 1 --above one for more sensitivity i think |
05 | RunS.Stepped:Connect( function () |
06 | Uis.MouseBehavior = Enum.MouseBehavior.LockCenter |
07 | Uis.MouseIconEnabled = false |
08 | local Delta = Uis:GetMouseDelta() |
09 | Uis.MouseDeltaSensitivity = Sensitivity |
10 | --script.Parent.Frame.Position = UDim2.new(.5,-Delta.X,.5,-Delta.Y) |
11 | game:GetService( "TweenService" ):Create(Frame,TweenInfo.new(. 1 ), { Position = UDim 2. new(. 5 ,-Delta.X,. 5 ,-Delta.Y) } ):Play() |
12 | end ) |