Question by
Tegomlee · Jul 27, 2017 at 03:10 AM ·
camerathird-person
How to rotate the camera?
Hello, I'm an aspiring game developer and I have a problem. I am trying to rotate the camera around the player on the Y-axis only.
I started with the roll a ball tutorial from unity and I am building upon that.
Here is the Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraController : MonoBehaviour {
public GameObject player;
private Vector3 offset;
void Start () {
offset = transform.position - player.transform.position;
}
void LateUpdate () {
transform.position = player.transform.position + offset;
}
}
Thanks in advanced, any and all help is appreciated.
Comment
Your answer