Object Touch allows the player to interact with objects in a Hype by tapping or holding them.
The Object Touch Node can be applied directly to Objects in which case it will only affect that specific object. If the Node is not embedded in an object it will affect all Objects in the groups selected in the Group Filter.
There are 3 Types of Object Touch that are set using the Type parameter in the advanced details panel.
The Touch Trigger effectively turns any object into a button that can be used to send signals to Objects or Nodes when the player interacts with it.
Signals can be sent when the touch is initiated, when the touch is being held, or when the touch is released.
Enabled | Enable or disable to node. Disabled Nodes cannot output links or data | |
Consume Touch | Prevents other touch-related components (like Joystick and Button) from being executed when you tap an object with Object Touch. | |
React Hidden Objects | Objects with Visibility turned off can still be touched by the player | |
“On End” When Disable Cancels Touch | If the object is being touched On Touch End is executed when the Node is disabled. | |
Type | Touch Trigger | Only allows touch triggers. |
Drag Ground | Allows dragging objects left and right/forward/backward along the ground based on the orientation of the Game Camera. | |
Drag Camera | Allows dragging objects left and right & up and down based on the orientation of the Game Camera. | |
Group Filter | Object Touch will only work in objects that have Color Groups specified here. *This option is only visible if the Node is not embedded in an Object. |
|
On Touch Start | Outputted value when the object starts receiving a touch input. | |
On Touch Move | Outputted value every frame the object is being dragged. | |
On Touch End | Outputted value when the touch input is stopped. |
Drag Ground allows the player to drag the object or objects left/right & forward/backward along the ground based on the orientation of the game camera.
Drag Ground can also send signals when the touch is initiated, when the touch is being held, or when the touch is released.
If the object has a Physical Node, it has to be set to Dynamic in order to be draggable.
Drag Ground & Drag Camera shame the same parameters.
Drag Camera allows the player to drag the object or objects left/right & up/down on a 2D plane based on the orientation of the game camera.
Drag Camera can also send signals when the touch is initiated, when the touch is being held, or when the touch is released.
If the object has a Physical Node, it has to be set to Dynamic in order to be draggable.
Enabled | Enables the component to function. | |
Drag Center Pivot | Drag an object from the center regardless of where the touch is initiated *This option is only visible if Type is set to Drag Ground or Drag Camera |
|
Release Out of Range | The object is released if it dragged beyond the Drag Max Length *This option is only visible if Type is set to Drag Ground or Drag Camera |
|
Consume Touch | Prevents other touch-related components (like Joystick and Button) from being executed when you tap an object with Object Touch. | |
React Only Physical Objects | Prevents objects without a Physical component from being touched or dragged by the user. *This option is only visible if the Node is not embedded in an Object. |
|
React Hidden Objects | Objects with Visibility turned off can still be touched by the player | |
“On End” When Disable Cancels Touch | If the object is being touched On Touch End is executed when the Node is disabled. | |
Type | Touch Trigger | Only allows touch triggers. |
Drag Ground | Allows dragging objects left and right/forward/backward along the ground based on the orientation of the Game Camera. | |
Drag Camera | Allows dragging objects left and right & up and down based on the orientation of the Game Camera. | |
Group Filter | Object Touch will only work in objects that have Color Groups specified here. *This option is only visible if the Node is not embedded in an Object. |
|
Drag Force | The Force being applied to the object when it is being dragged *This option is only visible if Type is set to Drag Ground or Drag Camera |
|
Drag Slowing | Slow the movement of dragged objects. Min Value = 0, Max Value = 1 *This option is only visible if Type is set to Drag Ground or Drag Camera |
|
Drag Max Length | Set the maximum distance an object can be dragged *This option is only visible if Type is set to Drag Ground or Drag Camera |
|
On Touch Start | Outputted value when the object starts receiving a touch input. | |
On Touch Move | Outputted value every frame the object is being dragged. | |
On Touch End | Outputted value when the touch input is stopped. |
Here's a link to the hype that shows how to implement and use the Object Touch node: