Scripting movement

Well, I tried to write a C# script using the knowledge I possess, and it was meant to make the camera rotate

But my lack of knowledge and time brought an error to me: as time goes by, the transform.position keeps changing, and that was not suposed to happpen.

So, if anyone could help me out, I would really appreciate.

Here’s the code:

using UnityEngine;
using System.Collections;

public class CameraControll : MonoBehaviour
{

    public float speedH = 0.75f;
    public float speedV = 2.0f;

    private float yaw = 0.0f;
    private float pitch = 0.0f;

    void Update()
    {
        yaw += speedH * Input.GetAxis("Mouse X");
        pitch -= speedV * Input.GetAxis("Mouse Y");

        transform.eulerAngles = new Vector3(pitch, yaw, 0.0f);
    }
}

nothing your doing there should affect the position.

The script itself doesn’t affect position, but it can cause translation to objects through parenting. any child scripts that are offset from a parent with this script will translate (looking like they are orbiting the parent).

also the pitch is usually clamped around between positive and negative 90 degreees before getting set to a eulerangle (unless you want the camera to do flips)