docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class Finger

    A source of touches (Touch).

    Inheritance
    object
    Finger
    Namespace: UnityEngine.InputSystem.EnhancedTouch
    Assembly: Unity.InputSystem.dll
    Syntax
    public class Finger
    Remarks

    Each Touchscreen has a limited number of fingers it supports corresponding to the total number of concurrent touches supported by the screen. Unlike a Touch, a Finger will stay the same and valid for the lifetime of its Touchscreen.

    Note that a Finger does not represent an actual physical finger in the world. That is, the same Finger instance might be used, for example, for a touch from the index finger at one point and then for a touch from the ring finger. Each Finger simply corresponds to the Nth touch on the given screen.

    Properties

    currentTouch

    The currently ongoing touch for the finger or default(Touch) (with valid being false) if no touch is currently in progress on the finger.

    Declaration
    public Touch currentTouch { get; }
    Property Value
    Type Description
    Touch
    See Also
    Touch

    index

    Index of the finger on screen. Each finger corresponds to the Nth touch on a screen.

    Declaration
    public int index { get; }
    Property Value
    Type Description
    int
    See Also
    Touch

    isActive

    Whether the finger is currently touching the screen.

    Declaration
    public bool isActive { get; }
    Property Value
    Type Description
    bool
    See Also
    Touch

    lastTouch

    The last touch that happened on the finger or default(Touch) (with valid being false) if no touch has been registered on the finger yet.

    Declaration
    public Touch lastTouch { get; }
    Property Value
    Type Description
    Touch
    Remarks

    A given touch will be returned from this property for as long as no new touch has been started. As soon as a new touch is registered on the finger, the property switches to the new touch.

    See Also
    Touch

    screen

    The screen that the finger is associated with.

    Declaration
    public Touchscreen screen { get; }
    Property Value
    Type Description
    Touchscreen

    Touchscreen associated with the touch.

    See Also
    Touch

    screenPosition

    The current position of the finger on the screen or default(Vector2) if there is no ongoing touch.

    Declaration
    public Vector2 screenPosition { get; }
    Property Value
    Type Description
    Vector2
    See Also
    Touch

    touchHistory

    The full touch history of the finger.

    Declaration
    public TouchHistory touchHistory { get; }
    Property Value
    Type Description
    TouchHistory
    Remarks

    The history is capped at maxHistoryLengthPerFinger. Once full, newer touch records will start overwriting older entries. Note that this means that a given touch will not trace all the way back to its beginning if it runs past the max history size.

    See Also
    Touch

    See Also

    Touch
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)