Advertisement
CakeMeister

UFO camera follow phan 4

Jul 18th, 2017
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class camera : MonoBehaviour {
  6.  
  7.     public Vector3 offset;
  8.     public GameObject player;
  9.     // Use this for initialization
  10.     void Start () {
  11.         offset = this.transform.position - player.transform.position;
  12.     }
  13.    
  14.     // Update is called once per frame
  15.     void Update () {
  16.         this.transform.position = player.transform.position + offset;
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement