How do I prevent random picks choosing last created?

0 favourites
  • 4 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • I have an object (thought) which spawns multiple copies.

    I want these to start destroying these at random (via the fade-out) as you can see above.

    My problem is that when using 'pick random instance' the engine will only choose the most recently generated instances. Whilst that's okay sometimes, at the moment it's working on a last-in-first-out basis, rather than random!

    When using the 'pick instance using IID' (using the generated 'temp' value), for some reason none of them get picked and none of them get destroyed.

    So how could I actually pick an instance at random? Is there something wrong with the order of logic above?

    Hope that all makes sense.

    Many thanks in advance!

  • I think I know why it's not happening as you intend.... (I'm a bit max'd by the color scheme ) As you have it, in the last condition group C2 is only considering the one thought object that was last created. So, just add a system 'Pick All - thought' at the top of that condition group. That will ensure C2 will pick from all of the thought objects that meet the subsequent conditions.

  • That's great Colludium! That worked.

    It's been bugging me for ages and I couldn't work out why it was happening. I'll keep the pick system in mind in future.

    Thanks again!

    BTW, the colour scheme is like that because other programs like Virtual Studio etc. are easier to use for long periods of time with those colours schemes. They don't hurt your eyes as much as 'bright' colour schemes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Psynaptik - glad it worked. I tried to emulate that color scheme a while ago but perhaps my aging eyes need the higher contrast of the standard scheme!

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