playMaker

Author Topic: Reusing FSM like component/script  (Read 1495 times)

hoyoyo80

  • Full Member
  • ***
  • Posts: 136
Reusing FSM like component/script
« on: August 25, 2020, 02:19:40 AM »
Hi all,

Let say im creating some basic mechanics like movement and jump in PM and later i want to use these FSMs to prototype other game quickly by simply adding it like script/component to the new object.How can i achieve this?

Thanks

Marc Saubion

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 79
Re: Reusing FSM like component/script
« Reply #1 on: August 25, 2020, 03:41:13 AM »
You can save your FSMs as templates and reuse them like scripts.

Templates can also be used as sub FSMs with the "run FSM" action. I recommend using the run FSM func action that allows for variables communication both ways so you can work with nested FSMs like prefabs.

hoyoyo80

  • Full Member
  • ***
  • Posts: 136
Re: Reusing FSM like component/script
« Reply #2 on: August 25, 2020, 04:07:30 AM »
Ok..so that solved it:) Thanks a lot.

EDIT: i have dig into Run FSM yet and how it is useful in a project. I imagine it like a generic function that all prefabs can use?
« Last Edit: August 25, 2020, 04:09:45 AM by hoyoyo80 »