A better mobile/console shiftlock implementation with proper parity to PC shiftlock, without forking PlayerModule.
No more mobile players spinning objects they're welded to!
The most popular mobile shiftlock from the toolbox seen on the left of the screen, and this implementation seen on the right of the screen.
What’s the difference?
This implementation uses UserGameSettings.RotationType, which is the property used by the default PlayerModule MouseLockController, avoiding setting the CFrame directly, so it behaves exactly the same as on PC.
This fixes the many issues caused by setting the CFrame, such as mobile players being able to spin objects they’re welded to, or spin while sitting.
Thought though: Wouldn’t it be faster to extract the color and update the Color3 of the image, instead of using a new image? That way the icon looks seamless and changes between Blue and white properly?
I ask because i saw this in the example thumbnail.
The icons are actually included with the client (rbxasset://textures/ui/mouseLock_off@2x.png), meaning they should be visible immediately and it gives developers the freedom to use different icons, you’re free to change the behavior to color if you like.
The icons are pretty low resolution so they shouldn’t take up much memory, other Roblox UIs do this too, I don’t think an included option is necessary but you’re free to edit it however you like.