M
M
maxemga2020-12-29 13:37:10
C++ / C#
maxemga, 2020-12-29 13:37:10

How to make sequential spawn of objects?

I have two positions where I need to spawn the Cube.
The logic is this, the cube should spawn on the left (I'll call the first position), then when I press the button, it should be deleted and the block should spawn on the right (second position)
How to implement this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GFX Data, 2020-12-30
@maxemga

public GameObject[] cubes;

void OnClick()
{
    cubes[0].SetActive(false);
    cubes[1].SetActive(true);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question