unity3d - Unity camera auto rotates and causes problems -


i have camera , want camera follow player. player can walk around cube camera must keep radius player.

i'm doing player's z x rotation of camera (with equation), problem is, x rotation of camera goes 0 90, @ 90 goes again 0 changes y , z rotation 180. gives me problems because should keep increasing x rotation 180 goes 90 0 again because y axis rotated automatically. how can dissable automatication?

camerascene.transform.rotation = quaternion.euler(( 180 * (transform.position.z - boxmin.z) / width), 0, 0);         newpos = new vector3(0, mathf.sin(camerascene.transform.eulerangles.x * mathf.deg2rad) * 35 + 25,             mathf.sin((camerascene.transform.eulerangles.x-90)* mathf.deg2rad) * 35);         camerascene.transform.position = newpos; 


Comments

Popular posts from this blog

ios - Memory not freeing up after popping viewcontroller using ARC -

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -