using System.Collections; using System.Collections.Generic; using UnityEngine; public class CharacterPushCtr : MonoBehaviour { public Transform camerTransf; bool isSet = false; // Start is called before the first frame update void Start() { //characterController.GetComponent(); StartCoroutine(waitSet()); } Vector3 v3 = new Vector3(); // Update is called once per frame void Update() { if (isSet) { v3.x = camerTransf.localPosition.x; v3.y = 0f;//this.transform.localPosition.y; v3.z = camerTransf.localPosition.z; this.transform.localPosition = v3; } } IEnumerator waitSet() { yield return new WaitForSeconds(5f); isSet = true; } }