Joystick and Button
The Joystick and Button blocks add UI controls to the screen. They will display only when they are executed.
Several combinations can be used below.

In a game, there can be only up to 2 joysticks, 4 buttons, or when used in combination, 1 joystick and 2 buttons per frame. Going above this limit produces an error of "Too many controls!"
They were introduced in version 1.8.
Joystick
Type | Script block |
Collider | None |
Folder | Control |
Ports | |
---|---|
Inputs | Before |
Outputs | Joy Dir After |
Adds joystick(s) to the screen. Unlike most of the blocks in Control tab, Joystick doesn't have any Execution output wires (aside from After, of course).
Notes
These are the following settings for the script block:
- XZ: Outputs XZ vector values perpendicular to camera direction (while assuming that the screen is always facing straight to a certain axis).
- Screen: Outputs XY vector values regardless of where the camera is facing.
If you use the XZ option, Joystick may not give the right outputs you need, because it only gives values perpendicular to the where the camera is facing. The values will seem normal if the camera is facing in Y-axis upwards or downwards, regardless of angle, but if it's facing sidewards or front and backwards it will only output X-axis value if you're looking at Z-axis and vice versa.
In this case you could instead use the Screen option which ignores where the camera is facing.
This will help but also there's still one more problem to solve: it only outputs values upwards and sidewards now!
This vector should now be rotated with Rotation input 90, 0, 0
.

Button
Type | Script block |
Collider | None |
Folder | Control |
Ports | |
---|---|
Inputs | Before |
Outputs | Button After |
Adds button(s) in the screen.
Notes
These are the settings for the following script block:
- Button: displays the button as a circular button
- Direction: displays the button as a directional arrow
Depending on the number of buttons set to Direction, they will display the following in left-to-right order:
- 1 button: ↑ .
- 2 buttons: ← , → .
- 3 buttons: ← , → , ↑ .
- 4 buttons: ← , → , ↓ , ↑ .
In total with the circular Button settings, UI is displayed in this manner:
- 1 button: right side.
- 2 buttons: both sides, with any Button set to Direction substituting the left first, unless a Joystick control exists, in which case the right will be substituted first.
- 3 buttons: similar to previous, but the slide to split the buttons depends on how many current Direction buttons are set: 2 and more will split the left, lesser will split the right. Regardless, directional button replacement occurs in left-to-right order.
- 4 buttons: spread equally, with directional buttons taking the place of first, second, fourth, and third column sequentially.