LoginSignup
0
0

More than 3 years have passed since last update.

Unity オブジェクトの移動

Last updated at Posted at 2020-11-14

Unity オブジェクトの移動

オブジェクトを上方向に移動させる際の手順をメモ。
オブジェクトは取得できている事が前提。

オブジェクトを上方向に移動させる。

test
    void Update()
    {
        // オブジェクトのtransform情報を取得
        Transform objTransform= hogeObject.transform;
        // その中からposition情報を取得
        Vector3 pos = objTransform.position;
        // 上方向成分を加算
        pos.y += 0.001f;
        // 反映
        objTransform.position = pos;
    }
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0