GetMouseDelta

Constructor:

GetMouseDelta()

Description

Returns the position offset of the player's mouse in the previous render frame (unit: pixel)

Return Value

Variable name Type Default Description
vector3 The offset of movement, X for the horizontal direction, Y for the vertical direction.

Examples

Observe whether the event of the player mouse position offset in the previous render frame is triggered or not

coroutine.start(function()
    while true do
        coroutine.wait(0.1)
        print(tostring(UserInputService.GetMouseDelta()))
    end
end)