Joystick Input

Description

The Joystick Input behavior is an advanced behavior that will output the X and Y value of the joystick position. You can use this to create advanced input controls that go beyond the built in Joystick Controlled behavior. This behavior will Trigger an event repeatedly while you're moving the joystick in any direction.

 

Properties

Triggers Repeatedly on Event

Object A

Select the joystick object to handle inputs from.

Trigger on Direction

Select a specific direction that the behavior will only trigger on. For example, if you set the direction to be Joystick Right, the behavior will only be triggered while the joystick is in the right position.

Minimum Threshold

How much the joystick needs to be moved from the center to register an event.

Normalize Output

When toggled on, the x and y outputs will be normalized. This means the x and y values will inclusively range from -1 to 1. For example, if the joystick was moved all the way down, y would be -1.

 

Outputs

X

This value indicates how much the joystick has moved in the X axis. Negative numbers indicate the joystick is moving left, positive indicate right. 

Y

This value indicates how much the joystick has moved in the X axis. Negative numbers indicate the joystick is moving down, positive indicate top.

Angle

This outputs the current angle of the joystick.

Object ID

This outputs the Object ID.

 

Examples

You can use this behavior if the built in Joystick Controlled behavior does not suite your needs. You can output the X and Y analog positions, and use other behaviors to move your object or add other gameplay elements.

Download Example Project

 

Related

Joystick Controlled

 

JoystickAnalogReference.gif

0 Comments

Article is closed for comments.