Question by
boryna05 · Jan 19, 2016 at 06:46 PM ·
camera rotation
Hi, i want to know how can i rotate camera with player
i start with this tutorial roll-a-ball, but here camra is frozen
using UnityEngine;
using System.Collections;
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;
}
}
Comment