Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: aare on February 21, 2019, 08:38:29 AM
-
Hi guys!
I stumbled upon an issue where my global array is not modified by the sub-fsm when passed as an inspector parameter, I'm guessing values are copied upon the call while I wan't to pass it as a reference.
Is there a way to pass global array to sub-fsm such that it'll be modified by it?
-
Hi.
Not sure what you mean by sub fsm.
-
I mean the fsm started using "Run FSM" action - that's the sub-fsm.
-
Hi.
Ak ok.
I believe at this moment when you place a exposed value (inspector parameter) it works as an input, not as output.
But if its a 'global' you do not need to pass it through. you should be able to select it directly inside the fsm.
But its recommended to minimal global variables (see this wiki (https://hutonggames.fogbugz.com/default.asp?W1462))
In the PlayMaker Beta version Run Fsm has a major update which makes the Action a lot more useful, as it can input/output/every frame directly + it will also work with 'Owner'.
If you wish, you can request access to PlayMaker Beta to Alex (http://hutonggames.com/playmakerforum/index.php?action=profile;u=3) or Jean (http://hutonggames.com/playmakerforum/index.php?action=profile;u=33)
As it beta, it is not recommended tho to use in real projects :)
-
Sadly I can't select that global array inside sub-fsm as I want to be able to run it twice on different variables. The workaround I settled on atm is to duplicate blocks in sub-fsm, assign global arrays accordingly, and pass a controlling int variable that branches into correct duplicated block group.
Glat to hear this is being adressed, looking forward to that update!