playMaker

Author Topic: Best Way to handle Object-wide variables  (Read 1217 times)

C.J.Geringer

  • Playmaker Newbie
  • *
  • Posts: 48
Best Way to handle Object-wide variables
« on: April 06, 2017, 01:04:36 PM »
If I undertsand correctly, local variables can only be acessed by the FSM, and global variables can be acessed by any FSM in the scene.

I need variables that can be acessed by any FSM ina given object. what si the best way to do this?

Currently I have a centralised FSM, that manages all such variables, and all other FSMs look to it to syncronize their local variables. Is there a better way?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Best Way to handle Object-wide variables
« Reply #1 on: April 07, 2017, 04:56:53 AM »
Hi,

That's fine, I do that always, I call them fsm "Meta data" and I usually make them do nothing apart from hosting the variables that have an object or prefab wide scope and all fsm must rely only on the data in this fsm and not their own copy of it, they always get it first and then work with it.

Bye,

 Jean