2ちゃんねる ■掲示板に戻る■ 全部 1- 最新50    

■ このスレッドは過去ログ倉庫に格納されています

【ゲームエンジン】Unity初心者質問スレBuild1

981 :名前は開発中のものです。:2019/03/05(火) 15:47:15.85 ID:CxDtBk+6.net
>>979
そりゃあTime.deltaTimeのところをどう書いたらいいかって質問への回答だから、もちろんこのまま貼り付けても期待通りには動かんよ。

Vector3 current = new Vector3( 1, 0, 0 );
Vector3 target = new Vector3( 10, 10, 10 );
float duration = 3.0f;
float speed;

void Start()
{
this.speed = (this.target - this.current).magnitude / this.duration;
}

void Update()
{
this.current = Vector3.MoveTowards( this.current, this.target, this.speed * Time.deltaTime );

this.transform.position = this.current;
}

Vector3.MoveTowardsのリファレンスちゃんと読んでる?

総レス数 1001
330 KB
新着レスの表示

掲示板に戻る 全部 前100 次100 最新50
read.cgi ver.24052200