followCamera.cs 556 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using ShadowKit;
  5. public class followCamera : MonoBehaviour {
  6. void Start () {
  7. }
  8. // Update is called once per frame
  9. void Update () {
  10. transform.position = SvrManager.Instance.head.transform.position + SvrManager.Instance.head.transform.forward * 2;
  11. transform.position = new Vector3(transform.position.x, 0.5f, transform.position.z);
  12. transform.LookAt(SvrManager.Instance.head.transform, Vector3.up);
  13. }
  14. }