Pick ID und destroy after spawn

0 favourites
  • 5 posts
From the Asset Store
Pick Up Items Sound effects for your game, Take them for a ride right now and you will worry no more.
  • Hi

    Simply cant figure out what I am doing wrong here

    After af spawns of a family with 4 diff sprites ( Slice1,Slice2,Slice3,Slice4)

    I pick the ID for Slice1

    This works fine since I can set its opacity and spawn the Blocker

    BUT when I want to destroy it goes wrong

    Any Idears

    [attachment=0:el4xzdxu][/attachment:el4xzdxu]

  • From the manual..

    Index IDs (IIDs)

    All objects at runtime have an index ID assigned, which is the number of the instance within its own object type. It is returned by the object's IID expression. For example, the first instance in two object types both have the IID 0, the second 1, and so on. Therefore the IID neither identifies a unique instance like the UID, nor does it persistently refer to the same instance (if IID 0 is destroyed, the next instance becomes IID 0). However, it can be useful for advanced users taking advantage of object expression indexing and the Pick Nth instance system condition.

    Maybe try using instance variables instead..

  • Thanks

    ... well getting a bit advanced for me

    How else could I pick 2 > Slice1 > spawn the blocker and destroy the 2 Slice1

  • The problem is that you're doing that every tick. On tick 1 it destroys two sprites. On tick 2 it destroys two more... etc. You need to add a condition to make that event only run one time.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Understanding picking with respect to Families

    Tutorial written by cacotigon

    Originally published on 10th, May 2013

    https://www.scirra.com/tutorials/556/un ... o-families

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