Files
PrinceOfGlory/Assets/Scripts/Help/CharacterPushCtr.cs
kridoo 6e91a0c7f0 111
2025-09-15 17:32:08 +08:00

39 lines
822 B
C#

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<CharacterController>();
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;
}
}