Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: sturmburg on May 01, 2013, 08:07:23 AM

Title: Want to destroy object when it's not visible, but not working properly.
Post by: sturmburg on May 01, 2013, 08:07:23 AM
Hi,

So I spawn a projectile and want to destroy it when it's no longer visible.  On the projectile itself I've got an FSM with a start state containing my Translate action.  When I test this it works fine.  The projectile is spawned properly and moves. 

In the same FSM I also have a global transition to a state that contains a Destroy Self action.  The problem is when I plug this global transition into the Game Object is Visible action (under false event) in the start state, the projectile no longer spawns (or it's being spawned and destroyed instantaneously).

Any ideas?

Thanks
Title: Re: Want to destroy object when it's not visible, but not working properly.
Post by: escpodgames on May 01, 2013, 08:46:59 AM
What is the destroy condition? ie if the projectile hits an object it then moves into another state, that state will destroy it.
Title: Re: Want to destroy object when it's not visible, but not working properly.
Post by: sturmburg on May 01, 2013, 08:53:09 AM
The only destroy condition I am trying to use right now is 'Game Object Is Visible' (which lives on the Start state of the projectile).  When I plug in the name of the global transition in the 'False Event' that has the Destroy Self action in it, it doesn't work.

It was my understanding that the false event in Game Object is Visible should only be called when the object is not visible by any camera.
Title: Re: Want to destroy object when it's not visible, but not working properly.
Post by: escpodgames on May 01, 2013, 09:10:17 AM
Gave it a test and you are correct ... very weird.
Title: Re: Want to destroy object when it's not visible, but not working properly.
Post by: 4ppleseed on May 06, 2013, 01:51:05 PM
Yep, this is happening to me too. I can't seem to destroy projectiles using Game Object is Visible = False = Destroy Self. As soon as you turn Game Object is Visible on - the projectiles will not spawn.

EDIT: Just did a little testing, seems the FALSE statement on Game Object is Visible is broken.