using System.Collections; using System.Collections.Generic; using UnityEngine; public class SphereMover : MonoBehaviour { // Update is called once per frame void Update() { transform.position += Vector3.right * 0.2f; if (transform.position.x > 5) { transform.position = new Vector3(-5, transform.position.y, transform.position.z); } } }