playMaker

Author Topic: Send Event when object that contains FSM is destroyed?  (Read 395 times)

stanimal

  • Playmaker Newbie
  • *
  • Posts: 11
    • Clean Energy Creatures
Send Event when object that contains FSM is destroyed?
« on: October 18, 2022, 09:14:33 AM »
I want to attach an FSM to a baddie that will send an event when the object is destroyed. Is there an FSM action based way to do this?

I've tried other methods but if I can simply broadcast an event upon the destruction of the object that would make life really easy.

Something obvious I'm missing? A fundamental reason you can do what I'm trying to do?

One thing I'll try when I'm home from work later is to have a Get Property set for every frame to check if the object is not Enabled... then the only question is will an object destroyed count as "not enabled" or fail to register on the FSM before being destroyed.

And as I'm about to post I'm also wondering if having an object as a child might help, as opposed to storing the "check for destruction" happen on the object itself.

Forgive me if I haven't described things well enough to make any suggestions, I'm in a bit of a hurry this morning. 

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Send Event when object that contains FSM is destroyed?
« Reply #1 on: October 18, 2022, 10:22:00 AM »
Hi.
Have you tried the system event DISABLED

Set a separate state and in that state put in your broadcast event (or something else)

then select Add global transition/system event/DISABLED

stanimal

  • Playmaker Newbie
  • *
  • Posts: 11
    • Clean Energy Creatures
Re: Send Event when object that contains FSM is destroyed?
« Reply #2 on: October 18, 2022, 09:33:46 PM »
Wow, must admit I've never made good use of System Events! This was exactly what I needed! Thanks for taking the time to help. Seems so obvious now!

Happy playmaker-ing!
 
:o