docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Save and load rebinds

    You can serialize override properties of Bindings by serializing them as JSON strings and restoring them from these. Use SaveBindingOverridesAsJson to create these strings and LoadBindingOverridesFromJson to restore overrides from them.

    // Store player rebinds in PlayerPrefs.
    var rebinds = playerInput.actions.SaveBindingOverridesAsJson();
    PlayerPrefs.SetString("rebinds", rebinds);
    
    // Restore player rebinds from PlayerPrefs (removes all existing
    // overrides on the actions; pass `false` for second argument
    // in case you want to prevent that).
    var rebinds = PlayerPrefs.GetString("rebinds");
    playerInput.actions.LoadBindingOverridesFromJson(rebinds);
    
    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)