docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Write custom interactions

    You can also write a custom Interaction to use in your project. You can use custom Interactions in the UI and code the same way you use built-in Interactions.

    Add a class implementing the IInputInteraction interface, like this:

    Warning

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

    Register your interaction with the Input System in your initialization code:

    Warning

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

    Your new Interaction is now available in the Input Action Asset Editor window.

    You can also add it in code using this call:

    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)