playMaker

Author Topic: OnDestroy FSM  (Read 1657 times)

Bhaz

  • Playmaker Newbie
  • *
  • Posts: 1
OnDestroy FSM
« on: July 17, 2019, 12:24:21 PM »
I'm new to FSM's and I am curious if it's possible (unless something else like it exists already) to have an FSM that: once an object is destroyed you can then (transition into) load a scene or have another action possible?

I've been trying to find a way that when my enemy character is destroyed/killed, a new scene will load up in unity.

Thore

  • Sr. Member
  • ****
  • Posts: 480
Re: OnDestroy FSM
« Reply #1 on: July 17, 2019, 12:40:11 PM »
Generally, you would design it such that other objects tell the player that it is now considered destroyed, and it then takes it from there, plays death animation, particles, sounds, and so on. Then, you can fire off a global event, your OnDestroy for instance, that triggers the next scene. After it executed everything, only then the player destroys itself.

Maybe there’s also an action that is fired on destroy, or maybe an event on exit action works, too.
« Last Edit: July 17, 2019, 12:42:06 PM by Thore »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: OnDestroy FSM
« Reply #2 on: July 17, 2019, 04:14:40 PM »
Hi.

This video might help to understand global events :