Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started 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
-
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'
-
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
-
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
-
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')