Pick random object doesn't pick random object?


As shown in the code, I want to have different type of code fall down as I group different clock inside a group.


But all it shows was the same clock falling down though, any help? Thanks

I believe “Pick a random object” works on the objects on screen, and not the objects within a group that haven’t been created. So you’ll need to have other clock types that are in the group on screen for it to work.

Yo can confirm this by placing a number of different clock types in the scene, and see what clocks are created.

MrMen is correct.

“Pick random object” works by saying “look at all of the conditions for this event to pick an object at random that meets the above requirements” (that exists in the scene currently, on screen doesn’t matter, and objects that haven’t been created in the game scene yet are ignored).

You’d need to have a way to randomly identify an object in the ClockGroup, which would normally require you to have them with all of the same name + a number, (e.g. Clock0, Clock1, Clock2, etc), and then create an object by name with ToString(Clock + random(2)).

1 Like