Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class CameraController : MonoBehaviour
- {
- public GameObject player;
- public GameObject cam;
- private Vector3 offset;
- // Use this for initialization
- void Start () {
- offset = cam.transform.position;
- }
- // Update is called once per frame
- void LateUpdate () {
- cam.transform.position = player.transform.position + offset;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement