How can you force shiftlock when tools are equipped?

Some games when you equip a weapon force shiftlock upon the character, and when the tool is unequipped shiftlock is disabled. I’d like a system like this.

So far I’ve scoured the forums for two hours or so now and found various articles on how to do this. However, when I’ve tried, they’ve either been too complex for me to understand or they don’t work, or they might just be a bit outdated.

Tried this method which kept returning a warning of “[no mouse lock callback found]” -Don’t understand the code:

Tried the solution for this post which came to no avail. I don’t really understand what’s going on in it:

There were a couple others I found which I can no longer find too.

1 Like

I’m not sure if this is too simple and won’t achieve what you need, but heres a shot anyway

you could use
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
I found out about it a few days ago.

Yeah, unfortunately not. I’d be looking for shiftlock and not center locking. Thanks for the suggestion though!

1 Like

To have the same effect, I think you could offset the camera a bit and simply add an icon in the middle (optional)

I thought about this too, however it wouldn’t give the same effect as shiftlock does I do not think as you’d still be able to rotate the camera around your character. There is an option in the Camera called CameraType which I had a quick look at too when you mentioned this but none of them would help achieve the effect sadly.

1 Like