Follow.cs 469 B

1234567891011121314151617181920
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Follow : MonoBehaviour
  5. {
  6. public GameObject o;
  7. // Start is called before the first frame update
  8. void Start()
  9. {
  10. }
  11. // Update is called once per frame
  12. void Update()
  13. {
  14. this.transform.eulerAngles = new Vector3(0, o.transform.eulerAngles.y, o.transform.eulerAngles.z);
  15. this.transform.position = o.transform.position;
  16. }
  17. }