【ゲームエンジン】Unity初心者質問スレBuild1at GAMEDEV
【ゲームエンジン】Unity初心者質問スレBuild1 - 暇つぶし2ch1025:名前は開発中のものです。
19/03/05 15:47:15.85 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のリファレンスちゃんと読んでる?


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch