Skip to content

Ties together the Input and Localization system to give you live Input Hints!

Notifications You must be signed in to change notification settings

noio/games.noio.input-hints

Repository files navigation

Input Hints

PreviewPreview

Input hints are little prompts in game that display the button, key or action that the player needs to perform to execute a certain action.

Press [A] to Jump

Unity's new Input and Localization systems are perfect for displaying dynamic Input Hints, changing depending on the actual bindings set up in the Input Actions. TextMesh Pro is used for displaying sprites inline in text strings. All that it needs is a little bit of plumbing, and this package is that plumbing!

Installation

You will need actual icons to display in the text. I can recommend the excellent PC & Consoles Controller Buttons Icons Pack. This package is based around the way they set up sprites.

  1. Install the package from the git URL
  2. I'm assuming you already have Input Actions and the Localization System set up.
  3. In Unity, go to Assets/Create/Noio/Input Hints Config
  4. Follow instructions on the Input Hints Config asset.
  5. Check out DeviceDetectorSample.cs

Manual Installation

If the button to automatically hook up the Localization Settings "Smart Format Source" does not work, this is the manual setup required:

  1. Click to Assets > Create > Localization > Variables Group
  2. In the newly created Variables Group Asset, add a variable, name it "input" and link the Input Hints Config.

Set Up Input Variables

  1. Go into the Localization Settings Asset and open up String Database > Smart Format > Sources > Persistent Variables Source
  2. Add the Variables Group Asset that you created in Step 1:

Added Variables Group in Settings

How to Use

Sample Configuration

See below for a sample setup that uses the actions defined in Unity's Default Input Action Map (Look, Move, Fire), and the controller icons linked above.

Sample Setup

Common Issues

Warnings like 'No binding found for ActionName with Control Scheme "Keyboard&Mouse"'

Makes sure to select at least one "Use in control scheme" for each binding in the Input Actions.

Input Actions Settings: Use in control scheme

Texts are not updating when switching input device

Try using LocalizeStringEvent instead of GameObjectLocalizer. It seems that the latter component sometimes does not respond when a localization variable is changed.

About

Ties together the Input and Localization system to give you live Input Hints!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages