Shaking screen using the gyroscope attitude (213690)

Hey,

I have an problem when I use Gyro attitude. When I move my telephone and then hold it still the screen is shaking for 3/4 seconds and then stop it.

How can I fix this??

Code:

if (Input.gyro.enabled)
        {
            transform.rotation = Quaternion.Euler(90.0f, 0.0f, 0.0f) * new Quaternion(Input.gyro.attitude.x, Input.gyro.attitude.y, -Input.gyro.attitude.z, -Input.gyro.attitude.w);
        }

Video: Video of the problem
The big shake is me and the little is my problem

2 Answers

2

Who can help me with this problem?

Smooth out the values using Quaternion.Lerp

I tried this, I'm getting an error. So I tried this GameObject go = bullet.Instantiate(bullet, bulletSpawnPoint.transform.position, Quaternion.identity); go.transform.forward = playerObj.transform.forward; bullet.Instantiate is giving me an error

–