Vector3 describing the Delta (change) between mouse/joystick movements.
This is useful when used with the input’s
InputObject/Position|position to track the position and movement of the user’s mouse/joystick, such as when you’re creating custom movement or camera scripts. Consider tracking input object changes using the
Instance/Changed event or when user input changes via events such as
Create a Binoculars Script
This example creates a binoculars script that decreases the player’s
UserInputService/MouseDeltaSensitivity|MouseDeltaSensitivity when a player with a
UserInputService/MouseEnabled|MouseEnabled left mouse clicks. The script also points the player’s
Camera towards the
DataType/Vector3|Vector3 world position of the mouse click determined by the
When the player left mouse clicks again, the player’s camera reverts back to the a custom
Enum/CameraType|CameraType with the same field of view and
Camera/CFrame|CFrame as before the player zoomed in with the script.
While the player uses the binoculars, the script locks the player’s mouse to the center of the screen by setting the player’s
UserInputType/MouseBehavior|MouseBehavior to LockCenter. The player’s camera moves when the player moves their mouse according to the
InputObject/Delta|InputObject.Delta property passed by
UserInputService/InputChanged|InputChanged indicating the mouse’s
DataType/Vector2|Vector2 change in screen position.
In order for this example to work as expected, it should be placed in a
The following example demonstrates one of many usage examples of handling user input from InputChanged depending on its type.