Click or drag to resize

UnityTouch Structure

A reimplementation of UnityEngine.Touch due to the deprecation of Unity Input Manager. Touch input can come from either UnityEngine.Input or UnityEngine.InputSystem, depending on settings. If Unity Input System is the source, some values will be invalid due to incompatibilities between the two systems.
Inheritance Hierarchy
SystemObject
  SystemValueType
    RewiredUnityTouch

Namespace: Rewired
Assembly: Rewired_Core (in Rewired_Core.dll) Version: 1.0.0+fd80194fe28f6b408ce098e98c53850d307c3a32
Syntax
C#
public struct UnityTouch

The UnityTouch type exposes the following members.

Fields
 NameDescription
Public fieldaltitudeAngle Value of 0 radians indicates that the stylus is parallel to the surface, pi/2 indicates that it is perpendicular. If the source of input is Unity Input System, this value will always be 0.
Public fieldazimuthAngle Value of 0 radians indicates that the stylus is pointed along the x-axis of the device. If the source of input is Unity Input System, this value will always be 0.
Public fielddeltaPosition The position delta since last change in pixel coordinates.
Public fielddeltaTime Amount of time that has passed since the last recorded change in Touch values. If the source of input is Unity Input System, this value will always be 0.
Public fieldfingerId The unique id for the touch.
Public fieldinputSourceType The source of input.
Public fieldmaximumPossiblePressure The maximum possible pressure value for a platform. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f. If the source of input is Unity Input System, this value will always be 1.
Public fieldphase Describes the phase of the touch.
Public fieldposition The position of the touch in screen space pixel coordinates.
Public fieldpressure The current amount of pressure being applied to a touch. For Unity Input Manager source: 1.0f is considered to be the pressure of an average touch. If Input.touchPressureSupported returns false, the value of this property will always be 1.0f. For Unity Input System source:
Public fieldradius An estimated value of the radius of a touch. For Unity Input Manager source: Add radiusVariance to get the maximum touch size, subtract it to get the minimum touch size. For Unity Input System source:
Public fieldradiusVariance This value determines the accuracy of the touch radius. Add this value to the radius to get the maximum touch size, subtract it to get the minimum touch size. If the source of input is Unity Input System, this value will always be 0.
Public fieldrawPosition The first position of the touch contact in screen space pixel coordinates.
Public fieldtapCount Number of taps.
Public fieldtype A value that indicates whether a touch was of Direct, Indirect, or Stylus type.
Top
See Also