About instantiate

I need to spawn cubes at random distance from each other. Like you see in the picture. There is three different arrows so, there will be three different ways for them. Cubes need to spawn like this randomly. (I put them with my hands for pic)

Whats the question? Or do you expect someone to write the code for you? (Since this is the scripting subforum).

I can’t do that so I’m asking that how can I do this instantiate. I can just spawn them in one way.

Usually one would keep a currentPosition variable (Vector3) and use that to:

  • Instantiate() the cube prefab (See docs for Instantiate)

  • adjust the currentPosition, by either one of three directions.