Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

jeredo / Control_VR

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Switch branch/tag
  • Control_VR
  • Car leap motion third_Final
  • Assets
  • CameraController.cs
Find file
BlameHistoryPermalink
  • Jeffrey Redondo's avatar
    First Unity Game · bcd7c254
    Jeffrey Redondo committed 7 years ago
    bcd7c254
CameraController.cs 437 Bytes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CameraController : MonoBehaviour {

    public GameObject player;
    public Vector3 offset;

	// Use this for initialization
	void Start () {
        offset = transform.position - player.transform.position;
	}
	
	// Update is called once per frame
	void LateUpdate () {
        transform.position = player.transform.position + offset;
	}
}