playMaker

Author Topic: Attaching FSM behavior to GameObject  (Read 2894 times)

turkeypotpie

  • Playmaker Newbie
  • *
  • Posts: 22
Attaching FSM behavior to GameObject
« on: January 10, 2013, 07:34:19 PM »
If I make a standard Monobehavior, I can attach it to whatever object I choose.

But if I make a behavior in a PlayMaker FSM, it's bound to the GameObject it was created on.  AFAIK, if I want to move the behavior to another type of GameObject (ie. in another prefab), I have to:

1.  Copy the component from one GameObject to another.
2.  Use templates to copy from one GameObject to another.
3.  Put my Fsm behavior in a separate prefab, and add that prefab as a child to each of my GameObjects.

Options #1 and #2 are more-or-less the same thing.  They are often bad practice because all the copying and pasting.

Option #3 works, but has some problems.  For one, it requires all states to be modified so they point to the relevant GameObject they modify.  In addition, not all state actions are relocatable.  For instance, all trigger and collision actions must be bound to their respective GameObjects.

Is there a better option that I'm missing?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Attaching FSM behavior to GameObject
« Reply #1 on: January 11, 2013, 02:07:02 AM »
Hi,

 Coming up on the next release :) you will be able to assign a template to a PlayMaker Fsm, not a copy, but a reference to the template. It's working well.

bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Attaching FSM behavior to GameObject
« Reply #2 on: January 11, 2013, 07:57:54 AM »
Hi,

 Coming up on the next release :) you will be able to assign a template to a PlayMaker Fsm, not a copy, but a reference to the template. It's working well.

bye,

 Jean

WOOOO!!  :D
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

turkeypotpie

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Attaching FSM behavior to GameObject
« Reply #3 on: January 11, 2013, 12:29:47 PM »
Sounds like a good solution.  Be looking forward to it.