docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Record control state history

    If you want to access the history of value changes on a control (for example, in order to compute exit velocity on a touch release), you can record state changes over time with InputStateHistory or InputStateHistory<TValue>. The latter restricts controls to those of a specific value type, which in turn simplifies some of the API.

    Warning

    It looks like the sample you are looking for does not exist.

    For example, if you want to have the last 100 samples of the left stick on the gamepad available, you can use this code:

    Warning

    It looks like the sample you are looking for does not exist.

    In This Article
    Back to top
    Copyright © 2026 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)