Skip to main content
All CollectionsInteractions
Creating Interactions With Gyroscope
Creating Interactions With Gyroscope
Updated over 3 months ago

A gyroscope is a device for measuring orientation. It spins freely around an axis. Your iPhone can act as a gyroscope, measuring your phone's orientation along the X, Y, and Z axes. Play lets you harness your phone's gyroscope and trigger actions when your phone is oriented in a specific direction.

Axis

The Axis property lets you choose the axis of rotation that the gyroscope will orient around. You can select the X, Y, or Z axis or use them all together.

In the diagrams below, the black line represents the axis, and the red arrow represents the direction you'll tilt your phone.

By default, our gyroscope will measure from a starting orientation of "80, 0, 0." This means 80º around the X axis (which simulates someone holding their phone) and 0º in the Y & Z axis (which means the phone is facing the user and upright). An orientation of "0, 0, 0" would be the phone laying flat on a surface.

You can adjust this starting point using the gyroscope trigger's X, Y, and Z Offset properties, which are available when the respective axis is selected.

Continuous Actions

Gyroscope triggers have Min and Max property values that are the endpoints of the range of degrees that the gyroscope trigger will recognize. When the gyroscope is at the Min degree value, the action will also be at its minimum value (or start state, if you're using a Set State action).

The opposite is also true. When the gyroscope is at the Max degree value, the action will be at its maximum value (or end state, if you're using a Set State action).

Within the gyroscope's range, the action will move continuously within its own range.

Did this answer your question?