[Solved] How to pick a RANDOM instance with lowest variable value?

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hello, I'm looking for a way to pick a random instance among the ones with the lowest variable value, the action 'pick instance with lowest value' doesn't work for me because it always pick the first IID of available instances... the idea is to pick a random, not always the first one.

    Example: Sometimes the lowest value of the variable I want to compare is 0, sometimes is 1, or 2, and so on, I need to be able to detect the lowest value among them and then pick a random instance between them

    anyone might have an idea on how to achieve that?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • NVM, just got it, in case some1 need a solution for that too, here's my method:

    system condition> Repeat 'highest variable value' times

    object condition> object variable = loopindex

    system condition> pick random object instance

    action>stop loop(system)

    action>(your other actions here)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)