playMaker

Author Topic: Paste Template in Script  (Read 1951 times)

jakeslack27

  • Playmaker Newbie
  • *
  • Posts: 11
Paste Template in Script
« on: December 03, 2015, 05:42:01 AM »
Hi,

In code, I'm looking to create a new GameObject and with it a PlayMakerFSM that has an initial set of States and Events.  I can do this via the editor fine by using the Paste Template functionality but I couldn't find a way to achieve this via code?  I can SetTemplate just fine but I would like each FSM instance to be unique.

p.s When using a Template in the editor, I always receive a 'Click To Edit' in the main state graph window and this never goes away, even if I click.  Looks like a bug!?

jakeslack27

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Paste Template in Script
« Reply #1 on: December 10, 2015, 04:57:18 PM »
Hello, I never found a way to achieve this.  Is this possible?

Thanks

PlaymakerNOOB

  • Full Member
  • ***
  • Posts: 219
Re: Paste Template in Script
« Reply #2 on: December 10, 2015, 08:43:16 PM »
Why dont you create a prefab of the gameobject, and then spawn those prefabs when you need them.  Making a Unity prefab will automatically copy the FSM's too.

jakeslack27

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Paste Template in Script
« Reply #3 on: December 23, 2015, 07:41:27 AM »
You're right, I can do that!  Thanks!