playMaker

Author Topic: how to check if an object is no longer in the scene[SOLVED]  (Read 2439 times)

pelikan13

  • Playmaker Newbie
  • *
  • Posts: 6
how to check if an object is no longer in the scene[SOLVED]
« on: November 05, 2013, 08:38:47 PM »
Hello!

here is my question, how can I check if an object is no longer in my scene?

There are several objects with the same tag in the scene and when the player destroys them all i want the game understand this and move on to another action.

Any tips?

Thanks!
« Last Edit: November 06, 2013, 12:44:22 AM by jeanfabre »

pdunton

  • Playmaker Newbie
  • *
  • Posts: 35
Re: how to check if an object is no longer in the scene
« Reply #1 on: November 05, 2013, 11:04:58 PM »
What I would do is create a variable to track the number of objects with that tag and when =0 send event to move on.  You could do this by anytime one of the objects is spawned, just add 1 to the variable (probably use an Int).  If the game starts with the pbjects already spawned, go into the variables menu and set the variable to say 50 if that is how many.  To remove, on the same state that you destroy the object (I'm assuming you destroy it) just subtract one.  And on another object, not the tagged objects set a constant Int compare where you test if the variable is equal to 0, then send an event.
Hoped this helped! Let me know if you have questions!
Thanks!

pelikan13

  • Playmaker Newbie
  • *
  • Posts: 6
Re: how to check if an object is no longer in the scene
« Reply #2 on: November 05, 2013, 11:54:25 PM »
That worked like a charm! thank you so much :)