4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ObjectをInstantiateするときに親Objectを指定する

Last updated at Posted at 2020-10-05

ObjectをInstantiateするときに親Objectを指定することで、親オブジェクトにつけたアニメーションと同じ動きを、新たに生成した子Objectにもつけることができます。

第四引数に親オブジェクトを指定することで、新たに生成するオブジェクトを子オブジェクトとして生成できます。

Instantiate(生成したいオブジェクト, transform, rote,親オブジェクト);

<注意>
親オブジェクトを宣言するときは
public GameObject 親オブジェクト; ではなく
public Transform 親オブジェクト;  になります。

<参考>
https://qiita.com/A-Kouki/items/9b79e6eb7e78d93af8c7

4
1
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
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?