Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class CameraController : MonoBehaviour
  5. {
  6. public GameObject player;
  7. public GameObject cam;
  8.  
  9. private Vector3 offset;
  10.  
  11. // Use this for initialization
  12. void Start () {
  13. offset = cam.transform.position;
  14. }
  15.  
  16. // Update is called once per frame
  17. void LateUpdate () {
  18. cam.transform.position = player.transform.position + offset;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement