UnityBiz/Create.cs
2024-09-08 15:56:04 +00:00

18 lines
432 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Create : MonoBehaviour
{
public GameObject[] objectToSpawn;
public int z,y;
// Start is called before the first frame update
void Start()
{
int rand = UnityEngine.Random.Range(0, objectToSpawn.Length);
Instantiate(objectToSpawn[rand], new Vector3(y,0,z), Quaternion.identity);
}
}