I’m trying to make a custom shiftlock system, it all works perfectly, however the second that the player is holding right click and moving their camera whist the shiftlock is turning on, the player’s camera completely freaks out upon mouse movement, and either snaps all the way up or down, whilst spinning around rapidly.
I wish I was joking, but I commented out literally the entire system to find the bug, until a singular line of code remained, and it was: UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter
For some reason, if the player is right clicking and moving their mouse while this line of code runs, the camera just completely freaks out. The line of code is not in a loop of any kind, it runs once and doesn’t run again.
I’ve tried:
• Setting camera to scriptable before changing it
• Putting it in a loop and strictly only setting it when the player isn’t holding right click
• Searching online to the point where I think my eyes are melting
Please, any help is very greatly appreciated.
Hope you’re having a good day.
That’s because it’s not an engine bug, and neither of those
If you want to implement custom shiftlock, you have to make your own player module
Because there is a specific condition check about the right mouse being held that causes it to be locked in place
The video shows exactly what my problem is, it’s not like the mouse isn’t locking, it’s just that the mouse is freaking out.
I showed what it’s like when enabling the shiftlock whilst moving your camera, then briefly what its like normally without it.
And before you ask - no there aren’t any other scripts in the gun - other than the animation.