Mobile Input Handling
Overview
ContextActionService helps effectively manage various input methods such as keyboard, mouse, and touch during gameplay, making it easy to implement context-sensitive interfaces. It allows you to manage player input conveniently and flexibly assign or remove actions based on the gameβs context.
Features
Can handle multiple input devices such as keyboards, mice, and touch in the same way.
Compatible with both OVERDARE Studio environments on PC and mobile platforms, simplifying input handling.
Can enable only the necessary inputs depending on specific situations, such as menu screens or gameplay.
Provides the ability to distinguish input states via UserInputState, allowing for detailed configuration of actions.
How to Use
1. Creating an Action
You can create an action using the BindAction function in a LocalScript. When creating the action, you can specify the actionβs name, whether to create a TouchButton, and the input key to be used on the PC.
The created action can have its text, button image, and position set as follows.
2. Disabling an Action
When a specific action is no longer needed, such as disabling the attack button when entering a shop, you can deactivate it using the UnbindAction function.
3. Handling Input States
You can implement handling for different input states such as input begin, input change, and input end using UserInputState.
Begin
When the input starts
Change
When the input is ongoing
End
When the input ends
Cancel
When the input is interrupted (e.g., when the input point moves out of the button area)
4. Retrieving a Specific Action
You can retrieve a specific button using the GetButton function.
5. Retrieving All Created Actions
You can retrieve all buttons using the GetAllBoundActionInfo function.
Last updated