【ゲームエンジン】Un ..
[2ch|▼Menu]
777:名前は開発中のものです。
20/03/08 17:40:35.63 +9Yp1l0D.net
>>776
いろいろ試してはいるのですがなんかエラー出ますm(__)m
そもそも生成自体ちゃんとできてないみたいです
どのように記述すればいいのでしょうか・・・?
public class sousa : MonoBehaviour
{
public GameObject obj; // インスペクターでプレハブ接続済み
public GameObject [] go=new GameObject[5];
// Start is called before the first frame update
void Start()
{
for (int i = 0; i <= 5; i++)  // オブジェクト複数生成
{
go[i] = Instantiate(obj);
go[i].transform.position = new Vector3(i, 0, 0);
}
}
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0)) //マウスクリックでランダム選択
{
Destroy(go[Random.Range(0,5)]);
}
}
}


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

2093日前に更新/306 KB
担当:undef