[Studio Beta] No-code Hotkey Hints With InputActionLabel
Key Takeaways
InputActionLabel is a new UI instance that makes cross-platform development easier by displaying an InputAction’s binding on-screen automatically – powered by the new PreferredBinding property.
Enable it through the “InputActionLabel” Studio Beta feature.
Hi Creators!
You can now easily build cross-platform UI that displays the correct bindings for all InputActions!
Players often have multiple input devices connected at once, and can switch between them mid-gameplay – connecting a gamepad, then reaching back for the keyboard. Showing a player which key or button triggers an action used to require a lot of manual work: calling GetImageForKeyCode, resolving the right binding per device, wiring up signals for device switches, and toggling between text and image states yourself.
Now you can skip all of that by adding a single InputActionLabel instance! Point it at an InputAction, and it displays the right hotkey no matter what device your players are on. It uses new APIs on the Input Action System that tracks the player’s current and preferred input device (similar to PreferredInput), so your hints stay correct without any device-switch logic from you.
Use this to easily build your HUD, ability bars, or interaction prompts.
There are three pieces to this release:
• InputActionLabel instance: A new UI instance that uses PreferredBinding to dynamically display the relevant binding in your game.
• DisplayName / DisplayImage: New properties on InputBinding that allow you to customize how each binding should display when queried.
• PreferredBinding: New property on InputAction that determines which binding is preferred based on a player’s connected input devices.
Keep reading for more details!
How to Enable the Beta
• Navigate to File > Beta Features.
• Find and check the box for InputActionLabel.
image31204×132 12.3 KB
• Restart Roblox Studio when prompted.
During this Studio bet…