FragMate CommunityLog in

FragMate - Software and Game Developer Community, including Resources, Forums, Marketplace & More.


descriptionRotate the camera on the y-Axis of the player

Hi, i just made a game where the Gamepad can be used. Im using the left Joystick for moving and the right one for rotating the Player and the camera. The camera is a child of the player so it follows up. The horizontal rotating is quite good but the vertical rotating is wrong. The camera has to rotate on the y-Axis of the Player.

At the moment it looks this way:

The camera is able to move but it doesnt focus the Player. But the player has to be always focused. Does someone know how to change my vertical-rotation-script for the right usage?


  // camera of the player
        public Transform kamera;
        // max camrotation vertical
        public float maxKameradrehungVertikal = 30.0f;
        // min camrotation vertical
        public float minKameradrehungVertikal = -30.0f;
        // actual camrotation vertical
        private float aktuelleKameraDrehungVertikal = 0;
    // rotate cam vertical
            aktuelleKameraDrehungVertikal = Mathf.Clamp(aktuelleKameraDrehungVertikal + rotationsVektor.y * rotationsGeschwindigkeitVertikal, minKameradrehungVertikal, maxKameradrehungVertikal);
            kamera.localRotation = Quaternion.identity;
            kamera.Rotate(Vector3.left, aktuelleKameraDrehungVertikal);

descriptionRe: Rotate the camera on the y-Axis of the player

Just fixed it by addin an empty GO and made it to the head of the player

descriptionRe: Rotate the camera on the y-Axis of the player


We see that you have some issues with your project/script, however we can help you for a price. If you would like us to work for you then please feel free to contact us at or on Skype at RenntekStudios thanks

Our prices are very cheap. Little errors we can fix for free, otherwise projects we can discuss prices. Hope you get in touch shortly thank you...
Permissions in this forum:
You cannot reply to topics in this forum