How do I lock the mouse and make it so the player's body moves with it?

So I made a gun and created a sort of camera offset as a makeshift shiftlock. I want to make it so the player’s body rotates as if it were shiftlock and also I want to lock the mouse in the center of the screen. Does anyone know how to do this?

  • Hide the mouse icon. You can do that by using an invisible mouse icon.
  • Add a mouse icon gui you want to use and keep it at center of the screen.
  • And now turn around the character with the mouse
  • See: How to make character move with mouse?

There might be better solutions too!

That’s all well and good but how do I keep the mouse at the center like you are suggesting?

Also sidenote: How do I lock the player’s camera at a certain position too? Like prevent them from zooming out and keep their camera level with their head?