- Home /
Tilt aircraft based on accelerometer
is hard to explain, so i put some images to visualize. i have the aircraft that not move on world space... i put a "LookAt" to move camera around. So when i go to the right (X=+1) i like to tilt the aircraft on Z axis. The same to other side.
See the images:
Everything is fine: camera, movement on a limit range... but i can't make the Camera tilt when i go right and left (the view, not the camera itself)... i try Quaternion.AngleAxis, Quaternion.Slerp, Quaternion.FromToRotation...
have you tried Camera.transform.localRotation = new Quaternion.Euler(x,y,z) or similar functions?
i got the rotation but strange behavior.. i tried on a empty gameobject (with camera and other things inside) but still a strange behavior. and no interpolation either. i need a new logic to do this...
the problem is the LookAt attach to camera... this disable the rotation of the camera.. i try without LookAt and works.... but the LookAt script that makes my camera look where i want; makes the camera behave like should be.
ok.. i got it. work perfect... but i have to change everything. Is a logical mistake.. so i delete the "lookAt" and I started from zero. thanks.