Instance destroy problems

  • Hi guys,

    I ran into a serrious problem, which Im not able to solve. The thing is, I want to have on all instances of Enemy pinned another sprites (same sprites, like fire or smoke) well, good and easy so far, problem comes when I want to destroy an Enemy and destroy the sprite pinned on him. Right now, the destruction of Enemy will destroy all second sprites pinned on other instances of Enemy. But I want to destroy Enemy instance and only one sprite attached to that particular instance, without destroying every instance of sprite attached to Enemy instances.

    Hope it is not too confusing.

    Im new to Construct and I must say its pretty awesome so far. Im not good in programming so please if there is some solution, make it easy to understand.

    Thanks in advance

  • I make an event that looks for any smoke that is not pinned, and destroy it.

    That way when the object it was attached to is destroyed, the orphaned smoke is taken care of.

  • Do you run it every tick, Paradox?

  • I thought about this, but I kind of lost myself in the middle. I tried to make an event, when Sprite is not pinned -> destroy sprite, but there is no unpinned event trigger. How did you do that Paradox?

  • It checks every tick, it's an if/then statement. If there is no unpinned sprite, nothing happens.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Use the is pinned condition, right click and choose invert to make the is not pinned condition.

  • Ok, Ill try that, not used to programming, so Im sorry to bother you with something easy as this.

    Anyway big thank you guys :)

  • Containers ?

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