Hi, I have a simple character with a camera which moves based on mouse movements. It works, but it’s a bit glitchy and i haven’t included deltaTime.
Here it is:
using UnityEngine;
using System.Collections;
public class CameraScript : MonoBehaviour {
public GameObject character;
void Update () {
this.gameObject.transform.RotateAround (character.transform.position,Vector3.up,Input.GetAxis ("mx") / 2500);
this.gameObject.transform.RotateAround (character.transform.position,Vector3.left,Input.GetAxis ("my") / 2500);
this.gameObject.transform.LookAt (character.transform.position);
}
}
Can anyone see a better way of doing this?