Im currently working on a game and unity and I do not have very much experience with Unity. I want to make a sphere game object spawn at one of four empty game object children. It should spawn after a trigger is triggered and it should choose randomly which empty game object children to spawn at. Does anyone have an idea of how to code this?
-
create references to the four game objects
-
on trigger, generate a random number 0-3
-
set the sphere’s location to the location of the game object that corresponds with the random number you generated.