playMaker

Author Topic: [SOLVED] Missing Cached Variables when debugging with breakpoints  (Read 8926 times)

sluresylta

  • Playmaker Newbie
  • *
  • Posts: 5
Hi - I submitted this bug report through the in-editor bug report tool, too, but since this bug completely breaks PlayMaker debugging for me, and I'm really rearing to go on this first PlayMaker project of mine, I post it here, too, in case someone has a brilliant insight that might fix things. Here's the text copied from the report tool:

Frequency: Always

1) What happened
I get the two following error messages in Unity's console while debugging with breakpoints (using Step To Next State Change In Any FSM), once I hit my first breakpoint:

Missing Cached Variables!
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMakerEditor.DebugFlow:Stop()
HutongGames.PlayMakerEditor.FsmEditor:PlaymodeChanged()
UnityEditor.EditorApplication:set_isPaused(Boolean)
HutongGames.PlayMakerEditor.FsmDebugger:Step()
HutongGames.PlayMakerEditor.DebugToolbar:DoPlaybackGUI()
HutongGames.PlayMakerEditor.DebugToolbar:OnGUI()
HutongGames.PlayMakerEditor.FsmGraphView:OnGUI(Rect)
HutongGames.PlayMakerEditor.FsmEditor:OnGUI()
FsmEditorWindow:OnGUI() (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:90)
UnityEditor.DockArea:OnGUI()

...and...

InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.Collections.Generic.List`1+Enumerator[HutongGames.PlayMaker.Fsm].VerifyState ()
System.Collections.Generic.List`1+Enumerator[HutongGames.PlayMaker.Fsm].MoveNext ()
HutongGames.PlayMakerEditor.DebugFlow.Stop ()
HutongGames.PlayMakerEditor.FsmEditor.PlaymodeChanged ()
UnityEditor.EditorApplication.Internal_PlaymodeStateChanged ()
UnityEditor.EditorApplication:set_isPaused(Boolean)
HutongGames.PlayMakerEditor.FsmDebugger:Step()
HutongGames.PlayMakerEditor.DebugToolbar:DoPlaybackGUI()
HutongGames.PlayMakerEditor.DebugToolbar:OnGUI()
HutongGames.PlayMakerEditor.FsmGraphView:OnGUI(Rect)
HutongGames.PlayMakerEditor.FsmEditor:OnGUI()
FsmEditorWindow:OnGUI() (at Assets/PlayMaker/Editor/FsmEditorWindow.cs:90)
UnityEditor.DockArea:OnGUI()

2) How can we reproduce it
I have no idea. I tried setting up a test scene with just a few states and one action on each of them, turned on breakpoints and the same debug step mode, but the errors don't show up in this scene. I also tried grepping the whole Playmaker folder for "Missing cached variables" and just "Missing", but found nothing seemingly relevant. A Google search turned up exactly nothing relevant in the sparse 9 results I got. So I'm hoping you will have an idea of what's wrong from the error messages. One notable fact is that I for some reason started out with using the action "Send Event 2" in the problematic scene/FSMs, before changing this to the "Send Event" action later. Maybe "Send Event 2" is an unfinished previous edition of the action, that shouldn't have been included in the release, and it somehow messed up something?

While I'm on that subject, there seems to be another similar oddity: Misc->Test Action seems a bit nonsensical.

Unity Info:
Unity Version: 3.5.1f2
Playmaker Version: 1.3.2 (24788)
BuildTarget: iPhone

System Info:
OS: Mac OS X 10.7.3
Processor: Intel(R) Core(TM) i5-2415M CPU @ 2.30GHz
System Memory: 2048
Graphics Device: Emulated iPhone 3GS / iPad running OpenGL ES2.0
« Last Edit: May 09, 2012, 12:36:57 PM by Alex Chouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Missing Cached Variables when debugging with breakpoints
« Reply #1 on: April 18, 2012, 03:15:08 PM »
Send Event 2 was indeed included by accident - you should use Send Event.

This sounds like an incompatibility between the new Debug Flow feature and the Debugging Step feature.

If you're not using Debug Flow, you can turn it off in Preferences > Debugging > Enable DebugFlow.

I'll look into this bug...

Thanks!
Alex

sluresylta

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Missing Cached Variables when debugging with breakpoints
« Reply #2 on: April 19, 2012, 04:20:07 AM »
Thanks for the quick reply  :)

But, regrettably, disabling the Debug Flow didn't fix the problem. Or rather: Unchecking the checkbox next to "Enable DebugFlow" didn't do anything - the debug flow still seems to be running in the FSM Log. I tried restarting Unity after disabling it. Any temporary fixes for disabling debug flow manually? Can I comment out some code or something like that?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Missing Cached Variables when debugging with breakpoints
« Reply #3 on: April 19, 2012, 06:32:03 AM »
You can disable Debug Flow on each FSM in the FSM tab, or globally in preferences. You could also try disabling logging entirely. I'll run some tests today...

sluresylta

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Missing Cached Variables when debugging with breakpoints
« Reply #4 on: April 20, 2012, 05:15:41 AM »
Sadly, no luck with any of that  :(

I've disabled Debug flow on all state machines in the project, and disabled logging in Preferences. The same errors pop up every time I try to debug.

Could it be related to my using the Send Event 2 action previously? Since that presumably is an incomplete action, perhaps it messed up something, maybe a cache somewhere, as seems to be indicated by the first error message? Maybe the actual Send Event action doesn't know how to set things straight with the cache, since under normal operation this shouldn't happen?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Missing Cached Variables when debugging with breakpoints
« Reply #5 on: April 20, 2012, 08:42:58 AM »
I don't think Send Event 2 is the problem. However, I haven't been able to repro this on my end. Would be great if you could send me a project with reliable repro steps!

Are you deleting an object when you get this error?

sluresylta

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Missing Cached Variables when debugging with breakpoints
« Reply #6 on: April 20, 2012, 08:48:23 AM »
Sure, I'll just send you the actual project I'm working on, I just started it anyway. Where/how do I send it?

sluresylta

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Missing Cached Variables when debugging with breakpoints
« Reply #7 on: April 20, 2012, 09:07:57 AM »
I'll try sending it to the mail address for your forum user; hopefully it's not too large an attachment.

pneill

  • Playmaker Newbie
  • *
  • Posts: 32
Re: Missing Cached Variables when debugging with breakpoints
« Reply #8 on: May 04, 2012, 12:22:06 AM »
I just noticed this bug too.   Any idea how to track down what the issue is?

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 4000
  • Official Playmaker Support
    • LinkedIn
Re: Missing Cached Variables when debugging with breakpoints
« Reply #9 on: May 04, 2012, 08:36:56 PM »
This should be fixed in the 1.3.3 update.

Grave_sts

  • Playmaker Newbie
  • *
  • Posts: 24
Re: [SOLVED] Missing Cached Variables when debugging with breakpoints
« Reply #10 on: May 16, 2012, 07:09:10 AM »
Hi all.

I am still receiving this error even after the update :|

Any help would be greatly appreciated

Thanks