playMaker

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

C.J.Geringer

  • Playmaker Newbie
  • *
  • Posts: 43
    • View Profile
Best Way to handle Object-wide variables
« on: April 06, 2017, 10:04:36 AM »
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: 12342
  • Official Playmaker Support
    • View Profile
Re: Best Way to handle Object-wide variables
« Reply #1 on: April 07, 2017, 01: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