How can I make the camera move when I'm moving my mouse without right-clicking?

So , I’m working on a third-person shooter game and I’m currently working on some guns for my game and I have no idea how to make the camera move when you are moving the mouse without right-clicking (just like in shift-lock) . I tried to find a solution for my problem but I couldn’t find anything. Could anyone help me with my problem? :smile:

Try taking a look at, UserInputService | Documentation - Roblox Creator Hub.
I think you are looking to lock the mouse to the center of the screen.

1 Like

I already locked the mouse to the center of the screen. :wink: I want to make the player’s screen move when she/he moves his/her mouse (just like when you’re zoomed in or you’re shiftlocked)

1 Like

Then you want to use mouse delta, which will tell you what you need to know to make the camera move when moving your mouse and with a locked cursor.

2 Likes

I have no idea how to do it :confused: I tried searching it up but i couldn’t find any examples of how to do it. Maybe i’m just locking the mouse in an incorrect way :thinking: ; here is how do it:

game:GetService('RunService').RenderStepped:Connect(function()  
game:GetService('UserInputService').MouseBehavior = Enum.MouseBehavior.LockCenter 
end) 

I replied to a similar post a while ago, which may be helpful to you.

3 Likes