タイトル: オブジェクトの移動・回転
移動
|
《Transform》.Tanslate( X値 , Y値 , Z値 ); もしくは 《Transform》.position += transform.方向 * speed * Time.deltaTime; |
回転
|
《Transform》.Rotate( X値 , Y値 , Z値 ); |
実装例
|
void Update() |
簡略化するなら、こんな感じでもできる。
|
void Update() float h = Input.GetAxis("Horizontal"); this.transform.Rotate(new Vector3(v, 0, -h)); } |
positionで前進処理をする場合は
|
void Update() this.transform.position += transform.forward * 0.1f * Time.deltaTime; } |