【ゲームエンジン】Unity初心者質問スレBuild1at GAMEDEV【ゲームエンジン】Unity初心者質問スレBuild1 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドのURL■項目テキスト1024:名前は開発中のものです。 19/03/05 15:38:14.93 hkFmsqcI.net なぜ動かないと思った? 状況を説明せんかいw 1025:名前は開発中のものです。 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のリファレンスちゃんと読んでる? 1026:名前は開発中のものです。 19/03/05 16:24:31.76 lOCuMyFe.net めっちゃ優しい 1027:名前は開発中のものです。 19/03/05 19:17:44.97 N7ZC2ho/.net >>981 ありがとうございます ボタンを押したらオブジェクトが動くようにしたいのですが、 エラーがいくつも出てる状態なので、 リファレンスなども参考にして直していこうと思います 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch