playMaker

Author Topic: Please help! How do I see variables in a Sub-StateMachine during runtime?  (Read 2446 times)

Mr Person

  • Playmaker Newbie
  • *
  • Posts: 5
Hello.

I've just upgraded to PlayMaker v1.8.4f5 and I'm running Unity v5.4.5p2.

I have an object with a PlayMaker FSM on it. The first thing this Root FSM does is fire a [Run FSM action] in order to boot up a Sub-StateMachine.

Inside this Sub-StateMachine, there's a whole bunch of variables I need to look at during run-time (for trouble-shooting).

Here's the error I'm having...

When I hit the Play button, and select the object with the Root FSM, and then click on "show" in the [Run FSM action]  to see the Sub-StateMachine, the variables shown under the Variables Tab belong to the Root FSM. I need to see the variables  that belong to the Sub-StateMachine.

In the previous version of PlayMaker I was able to see the Sub-StateMahcine’s variables during run-time with no issues; but now all I can pull up is the Root FSM's variables.

Is this a bug? Or is there a way of seeing the Sub-StateMachine’s variables during run-time that I'm unaware of?

Thank you very much for your time! :)
« Last Edit: June 05, 2017, 06:09:23 PM by Mr Person »

Doh

  • Full Member
  • ***
  • Posts: 124
I have yet to use sub-state machines, though can you not toggle the visible in inspector check box before pressing play to see them in the inspector view?

Doh

  • Full Member
  • ***
  • Posts: 124
Sorry forgot to mention, the toggle box is in the variable tab, first select the variable, you should then see the option near the bottom of the tab.

Mr Person

  • Playmaker Newbie
  • *
  • Posts: 5
Thanks for the quick response!

I tried what you suggested, but the variables in the sub-stateMachine didn't appear in the inspector. It looks like toggling "visible" only works for variables in the Root FSM. :(

I've found a work-around, but it's not great.

During runtime, if I select a state that uses a variable (such as with a [Int Compare]) it'll display the stored result of the variable in a text field below "Interger 1."

This work-around is okay, but it means I have to search for states that use the variables every time I want to check on a variable. There must be a quicker way to check all variables in a sub-stateMachine without having to hunt for states that make use of them. o_o

If anyone knows of another way to check sub-stateMachine variables during runtime, please let me know. :)

Eidrog

  • Playmaker Newbie
  • *
  • Posts: 5
I'm having the same issue in Unity 5.4.5f1

The only work-around I've found is: if you have a state in a sub-FSM that references a variable you can click on the state and see the value of the variable inside of whatever action is referencing it.

*EDIT* Heh, I see you found the same work-around I did.

If anyone finds a better work-around or a fix for this please share! =)

Should this be flagged in Playmaker Bug Reporting?
« Last Edit: June 05, 2017, 08:06:28 PM by Eidrog »

Doh

  • Full Member
  • ***
  • Posts: 124
Oh that's a shame.

I don't want to suggest a hacky idea, but, have you tried querying the variable using a "get" action, if you just need to debug a few variables at a time you could set up a dummy FSM that runs the query every frame and simply monitor that.

This not ideal though.

Fingers crossed one of the more experienced users/devs see this thread.

Mr Person

  • Playmaker Newbie
  • *
  • Posts: 5
Hee hee, clever solution. XD

I've thought about using the [Debug Log] action to log what the variables are being set to, but this also feels pretty hacky. @_@

I think I'm going to log this issue as a bug.

Outside of runtime, selecting the Variables tab in a sub-FSM shows you the sub-FMS's variables, not the Root-FSM's. The fact that the the Variables tab shows the Root-FSM's variables during runtime feels like a bug.

Also, my previous version of PlayMaker let me view Sub-FSM variables during runtime using the same method I described above, so I think somethings broken with this new version.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Hi,

 Yeah, Sub Fsm debugging is not yet fully covered. I have forwared this, hopefully this will improve in coming versions.

Bye,

 Jean

Mr Person

  • Playmaker Newbie
  • *
  • Posts: 5
Alright, good to know.  :)

Thanks for sharing that Jeanfabre.