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 target;
- private Quaternion desiredRotation;
- private Vector3 offset;
- void Awake () {
- desiredRotation = transform.rotation;
- offset = transform.position;
- }
- void LateUpdate () {
- transform.rotation = desiredRotation;
- transform.position = target.transform.position + offset;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement