object.accuracy

Type Number
Object InputAxis
Revision Release 2024.3703
Keywords device, input, axis, accuracy

Overview

The +/− accuracy of the data provided by the axis input. This value will always be greater than or equal to 0. For example, if the accuracy is 0.01, an axis value of 0.5 is accurate between 0.49 and 0.51.

Gotchas

Example

-- Fetch all input devices currently connected to the system
local inputDevices = system.getInputDevices()

-- Traverse all input devices
for deviceIndex = 1,#inputDevices do
    -- Fetch the input device's axes
    local inputAxes = inputDevices[deviceIndex]:getAxes()

    -- Print all axis accuracy values
    for axisIndex = 1,#inputAxes do
        local inputAxis = inputAxes[axisIndex]
        print( inputAxis.descriptor .. ": Accuracy = " .. tostring(inputAxis.accuracy) )
    end
end