There are multiple nodes for detecting different types of player input. These are commonly used for Character Movement or player interaction in the game.
The Button is an input used by players to play your game. When the button is pressed, linked nodes will receive values and/or be executed.
In this example, the button is used to make the player character jump.
The Joystick can be used by players to play your game like a traditional Game Controller joystick or analogue stick. The Joystick outputs values based on the direction and magnitude it is being pushed.
In this example, it is used to move the player character around.
Screen touch can be used to detect when player touches the screen. You can use the component to get the position of the screen the player touches.
In this example, the player taps the touch screen to make the character dance.
Other player inputs include Gestures and detecting Object Touch. You can also use the device information, like Motion or Orientation as input.
Gesture node can be used to track one one of 4 swipe gestures. When the user performs the specified gesture this component listens to, the output will be triggered.
In this example, the player swipes to the side to move the character sideways, and up to make it jump.
Object Touch allows the player to interact with objects in a game by tapping or holding them. If target is set, the touch will only affect that specific object. If the Node has no target, then Group Filter will be used
Object touch can be used as simple trigger, or to drag Dynamic object along along the Ground or Camera plane.
In this example, you can drag the cube by tapping and holding it.
Device motion and Orientation are always executing. The first tracks the motion of the mobile device and outputs it based on the component's type, while the second tracks the orientation of the mobile device and outputs it based on the component's type.
You can also build custom buttons using the User Interface node. To create custom buttons, simply add the UI node to the scene and open the UI editor from the details panel.
From the bottom of the screen you can add a Button component to the canvas. Once it is added, you can find the relevant output in the UI node. After this, it works similarly to the button mentioned above.
In this example, the button created using the UI node will add a hat to the player character.