playMaker

Author Topic: multiple objects with same fsm  (Read 1863 times)

bigrip

  • Playmaker Newbie
  • *
  • Posts: 3
multiple objects with same fsm
« on: October 08, 2015, 05:41:09 PM »
hi

lets say i have a button an a door,i set a global variable to open the door,
what if i want more doors ,do i need for every door, and button a new object with a different global variable?
Or is there a way to make a instance/prefab so i can simple drop many buttons and doors
in my scene and the globalvariables changes/increment  automatically?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: multiple objects with same fsm
« Reply #1 on: October 09, 2015, 01:23:11 AM »
Hi,
that depend what the variable is needed for

if (for example) you need to count how many doors are opened you can use int add to a global and you can then simply duplicate your doors
and you can make your door fsm a template so when you want to change something it will be changed on all doors

ManicMinerUK

  • Junior Playmaker
  • **
  • Posts: 51
Re: multiple objects with same fsm
« Reply #2 on: October 11, 2015, 08:28:45 AM »
this sounds like something you don't want to do with global variables.

I'd recommend using local variables, and using the get/set FSM actions in Playmaker.