Sprint 5, 6 : Gyro in progress
- Shiyu
- Jul 26, 2021
- 1 min read
I followed a youtube tutorial: https://youtu.be/Woi-pkAlwxg
I first created a Gyro Manager, instance, so i can call it anytime.

Next, I'have a logic header that has gyroscope, rotation of phone, and a bool to check if gyro is active or not.

This next part is to check whether the phone has gyro or not, and activate it.

Next, a public function to get rotation.

This script will then be dragged onto an empty game object, renamed the GyroManager.

Next, I followed the tutorial and created a new script called FollowGyro, this one aims to put the game object rotation same as the phone's gyro rotation.

I tried following this tutorial and it didn't work for me, as mine has to work in AR while his did not.
Comments