with these you can use a joystick and buttons to controls things in your games.

You can use several combinations, as shown in the image bellow.

But there's a limit to keep in mind, imagine a joystick is worth 2 points, and buttons are 1 point, then the limit is that you can only use up to 4 points. So you can only have:

  • 2 joysticks
  • 1 joystick and 2 buttons
  • 1 to 4 buttons

Joystick

Adds joystick(s) in the screen. Unlike most of the blocks in Control tab, Joystick doesn't have any execution (yellow) output wire

Output

  • Joy Dir: (Joystick Direction) Outputs joystick movement's direction.

Settings

  • 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.

Notes

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! Well, the solution is actually pretty simple! Just use rotate vector with Rotation input [90, 0, 0].


Button

Adds button(s) in the screen.

Output

  • Button: Executes when the button display is pressed.

Settings

  • Button - displays the button as a circular button
  • Direction - displays the button as a directional arrow

Setting the display to "Direction" mode results in the following:

  • 1 button - one button is displayed as arrow pointing up
  • 2 buttons - two buttons are displayed as arrows facing left and right respectively.
  • 3 buttons - three buttons are displayed as arrows facing left, right and up respectively.
  • 4 buttons - four buttons are displayed as arrows facing left, right, down and up respectively.