Example 6 Gyroscope Controls

This example has been set up as a jump and run game. It will only work on a mobile device. To move forward, start with the device on a 45 degree angle, and tilt the device down, and back up to stop or move backwards. To roll left, swipe left, and to roll right, swipe right. To jump over the lower walls, swipe up.

The Gyroscope Action has been set to only use the y Axis to move forward and back, and not the x Axis to move left and right. This is done with the Swipe Triggers. This can be seen in the Hierarchy.

As there is no touchsticks needed, the Swipe Triggers have been set to utilise the entire screen.

The rest is self explanatory. Have a play and enjoy.

Last updated