I'm trying to make a third-person shooter type game of sorts, and I'm running into a couple of problems. One such problem is that I want to lock the player's cursor to the center of the screen like how it's like in a first person shooter.
I have tried using the LockCenter Enum of MouseBehavior shown in ROBLOX Wiki (code below, but its just the example they gave), but my cursor still moves around freely.
local UserInputService = game:GetService("UserInputService") UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter UserInputService.InputChanged:connect(function(inputObject) if inputObject.UserInputType == Enum.UserInputType.MouseMovement then print("delta is (" .. tostring(inputObject.Delta.x) .. ", " .. tostring(inputObject.Delta.y) .. ")") end end)
Hello VongolaXII,'
Your answer is right here: https://www.youtube.com/watch?v=7CcKCO7z54o Watch this video! By the way the lines the guy says is different now. The first line he says is in line 197 and the second line is in 247