Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: MlleBun on July 03, 2020, 08:05:37 AM

Title: All Destroy actions are instantly validated
Post by: MlleBun on July 03, 2020, 08:05:37 AM
Hi everyone! I'm just starting with Playmaker so, sorry if this question has already been asked. I would like to Destroy a gameobject on TriggerExit.

When I send a FINISHED event on TriggerExit to a state that deactivate the gameobject, the behaviour is ok. The gameobject deactivate at FINISHED.
But if I bring this transition to a State with a Destroy action (or Destroy Object), the gameobject is destroyed instantly (on TriggerEnter).

Can someone help me figuring this out? Thanks
Title: Re: All Destroy actions are instantly validated
Post by: djaydino on July 03, 2020, 05:33:47 PM
Hi.
On trigger event you should not use 'Finished'
Set a different transition event.

If that does not help set the trigger Exit in a separate state after you did 'Activate Game Object'
Title: Re: All Destroy actions are instantly validated
Post by: jeanfabre on July 06, 2020, 01:46:00 AM
Hi,

 Like djaydino said, don't use FINISHED event manually, this is a special event that is used internally by playmaker called when all actions within a state are done.

Bye,

 Jean
Title: Re: All Destroy actions are instantly validated
Post by: MlleBun on July 06, 2020, 07:37:41 AM
Thanks for your response. I tried a System Event TRIGGER ENTER or TRIGGER EXIT and also a custom event but those two methods do not seem to work. What am I missing ? Could you post a screen on a onTriggerEnter state transitioning to a DestroySelf ? Many thanks again
Title: Re: All Destroy actions are instantly validated
Post by: djaydino on July 06, 2020, 08:28:09 AM
Hi.
Try adding a state between the destroy and trigger event and add a 'Next Frame Event'

Have you tried setting the 'Activate Gameobject in a separate state?

For the event, use your own made event (for example 'isTriggered')