using System.Collections; using System.Collections.Generic; using UnityEngine; public class camera : MonoBehaviour { GameObject object1; Vector3 movement; // Start is called before the first frame update void Start() { object1 = GameObject.Find("Ball"); // object1 = GameObject.FindGameObjectsWithTag("Ball")[0]; movement = gameObject.transform.position - object1.transform.position; } // Update is called once per frame void Update() { gameObject.transform.position = object1.transform.position + movement; } }