How do I differ one object from others

0 favourites
  • 5 posts
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • I have two same object appears at the same time, but created in different inteval. When my hero shoot at one object, the other one responded too. How to prevent other object from same group to respond?

    I'm using free version. Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What do you mean by "responded"?

    Events like SpriteA on collision with SpriteB -> destroy SpriteB will only destroy a SpriteB instance that was picked by collision, other instances will not be affected.

    If you post your capx file, or screenshot of your events, then we could find out what is going on.

  • Here is the screenshot of my events.

    Hero will shoot harpoon, and when hit the enemy, a rope will appears connecting hero to the enemy, and that enemy will pulled closer to hero and destroyed.

    PROBLEM:

    The other enemy on screen will pulled also without rope.

  • That is correct

    because in event System: ShootEnemy = 1 you are not specifying which instance of the enemy should be affected.

    You are saying "if ShootEnemy = 1 then set angle of all Enemies towards player"

    Give your enemy a variable - boolean "hit" will be fine. and then:

    -Harpoon: On collision with Enemy -> Enemy.hit set to true

    -System: ShootEnemy = 1 and Enemy.hit = true -> Set enemy angle etc....

  • Thanks, Shinkan!

    I miss the instance variables stuff. Now it works! )

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