Update 関数で呼び出しているプロセスが発生するまでに遅延を与える必要があります。CoUpdate の回避策も試しました。これが私のコードです:-
function Start()
{
StartCoroutine("CoStart");
}
function CoStart() : IEnumerator
{
while(true)
{
yield CoUpdate();
}
}
function CoUpdate()
{
//I have placed the code of the Update().
//And called the wait function wherever needed.
}
function wait()
{
checkOnce=1; //Whenever the character is moved.
yield WaitForSeconds(2); //Delay of 2 seconds.
}
三人称コントローラー (別のオブジェクト) が境界の外に移動したときに、オブジェクトを移動する必要があります。コードに「yield」を含めました。しかし、発生している問題は次のとおりです。Update() でコードを指定したときに移動していたオブジェクトが移動していますが、停止していません。しかも上下に動いています。何が起こっているのかわからない!誰か助けてくれませんか?お願いします、ありがとう。