Transform meatballSlots;
GameObject meatball;
private void Update()
{
foreach (Transform meatballSlot in meatballSlots)
{
if (Input.GetKeyDown(KeyCode.Space))
{
Instantiate(meatball, meatballSlot);
}
}
}
how can i to instantiate the “meatball” as child of “meatballSlot” consecutive, right now if i press space the “meatball” will instantiate on every “meatbalSlot”, but i need instantiate will consecutive from 0, 1, 2, 3 and then when press each space