0
Answered

And how can I use the instantiate action to have…

jpdevin 1 month ago in Game Creator updated by Marti (Lead Developer) 4 weeks ago 3

And how can I use the instantiate action to have the prefab instantiated at a random place ?

Thxs.

Unity version:
2018.4
Game Creator version:
1.1.1

Answer

Answer
Answered

I'm opening a separate topic for your question. Please, make sure from now on to post each question in a different topic. This helps keep things organized.

Regarding your question, you can use a List Variables pre-filled with random positions (use either Vector3 or Game Object types). Then, using the "Instantiate" action, set the position's source as a List Variable. You'll be able to choose "random" from the list of options available.

Cheers!

GOOD, I'M SATISFIED
Satisfaction mark by jpdevin 1 month ago
Answer
Answered

I'm opening a separate topic for your question. Please, make sure from now on to post each question in a different topic. This helps keep things organized.

Regarding your question, you can use a List Variables pre-filled with random positions (use either Vector3 or Game Object types). Then, using the "Instantiate" action, set the position's source as a List Variable. You'll be able to choose "random" from the list of options available.

Cheers!

Your "random" option is finally not doing the job : I have several objects instantiated at the same random position. 

Well, the "random" pick from a List Variable is just random. If you want more fine grain control you can always create a custom Action similar to "Instantiate" Action and use the Random.unitInsideCircle property.

Despite this, with the current system it should work just fine. However, bear in mind that if you have 3 possible positions and you instantiate 2 items randomly, there's a slight chance that these will appear at the same position. To solve this, either increase the amount of slots in the List Variable or create a custom Action (if you can code) that completely randomizes the position.