Ive got an iPhone-prefab (2D Side Scroller) in my scene, and I want to rotate the camera 90 degrees at one point.
When I select the object at its top hierarchy and change the y-rotation to 90 degrees, the rotation centers on the Player object. This means the Player-object does only rotate and doesnt move, while the other objects (like camera) circling the Player move in space as well as rotate.
However, when doing this using a script, the object distorts in a haphazard way. This also happens when I run the game and manually input the change in degrees in the inspector.
This is the code used:
transform.localRotation = Quaternion.Euler( transform.eulerAngles.x, 90, transform.eulerAngles.z );
It seems that once the Player-objects starts moving, the center of the whole object (2D Side Scroller) gets screwed up and stops concentrating on any specific object. Rather it focuses on a center that is made up between the joysticks (in this case the Dual TouchPad) which doesnt move at all when the Player moves, and the Player.
This makes using any of the transform properties of the Player useless, unless anybody have a solution for this?