picking instance by boolean instance variable

0 favourites
  • 9 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • Hey!

    All is in title... I tried to do it with "pick instance by comparison" but i can't find find the way to use boolean instance variable in "expression" field.

    thanks for reading

  • Why not just use the sprite condition - is boolean instead of system compare?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I try to use this kind of system :

    when "sprite" collide "player", "sprite" instance variable is set to boolean "destroyable". When "sprite" "destroyable" variable is true > wait 1 seconde > destroy "sprite".

    I guess it's a simple and efficient way to destroy only sprite that have been in collision with player. Isn't it?

  • Sprite on collision with player

    sprite destroy

    would only destroy the instance of the sprite that collides with the player..

    If you really want to check the boolean it would be:

    Sprite on collision with player

    sprite is boolean

    sprite destroy

  • Ooops, my bad, i forgot to say my sprite is actually a family.

    If I set "destroy" family, all objects of this family are destroyed.

    So i want to use boolean instance to pick what object have to be destroyed.

  • If you destroy on collision only the family member colliding will be destroyed, for it is picked in the event and the others aren't..

    And again, my above events are still the ones to use, just replace sprite with family..

  • Ok, i see what you mean.

    Thank you.

    I have some questions :

    Is it possible to pick an instance by boolean instance and if it's possible, how to do it?

    Where can i find a tutorial about picking instance by instance variable?

  • Ok, i see what you mean.

    Thank you.

    I have some questions :

    Is it possible to pick an instance by boolean instance and if it's possible, how to do it?

    Where can i find a tutorial about picking instance by instance variable?

    I thought I already said how to pick by boolean?

    "object is boolean instance variable set" - condition..

    For other instance variables it would be

    "object compare instance variable" - condition

  • If you really want to check the boolean it would be:

    Sprite on collision with player

    sprite is boolean

    > sprite destroy

    Sorry... I didn't get it on first time, I'm not so good in english actually.

    Literally translated in my language, "check" does not mention the fact to pick.

    Thank you for having insisted

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