Loading...

Logo
DocumentationBehaviorsInteractionTilt Sensor
Interaction

Tilt Sensor

Last updated February 21, 2017

Description

The Tilt Sensor behavior is an advanced behavior that will output the X and Y value of the tilted device. You can use this to create advanced input controls that go beyond the built in Tilt Controlled behavior. This behavior will Trigger an event repeatedly while you're tilting the device in any direction.

Properties

Triggers Repeatedly on Event

Object A

This is the object you want to control by tilting. By default the current object is selected, but you can tap the graphic to change it to any other object in your scene.

Tilt Positon

This allows you to set a default resting position for your devices tilt. For example, 'Regular' is optimal for when you are sitting on a char, or 'Top Down' is food for when your device is flat on a table.

Trigger on Direction

Select a specific direction that the behavior will trigger on. For example, if you set the direction to be Tilt Right, the behavior will only be triggered while the device is tilted to the right.

Minimum Threshold

How much the device needs to be tilted in order for the tilt to register.

Outputs

X

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

Y

This value indicates how much the device has tilted in the X axis. Negative numbers indicate the device is tilted down, positive indicates up.

Amount

The behavior will output the amount the device is being tilted from its original position. This value ranges from 0 to 1 where 0 is resting and 1 is fully tilted.

Angle

The angle in degrees that the device has tilted from its resting position.

Object ID

This outputs the Object ID.

Examples

You can use this behavior if the built in Tilt Controlled behavior does not suit 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

Tilt Controlled

TiltAnalogReference.gif