Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Breadman on November 29, 2016, 05:33:27 PM

Title: "Get Mouse ___" actions not running every frame
Post by: Breadman on November 29, 2016, 05:33:27 PM
Hey everyone,

I'm trying to track my mouse position every frame. I have found several useful scripts (including Lane's which I've used successfully in the past), but for some reason, in this new project, they stop updating their variables after the first frame. I have "every frame" enabled, of course, but for some reason they only update once or twice immediately after hitting "play", and then never again.

The project is pretty new and doesn't have very much going on yet. I'm able to reproduce the same issue in a new scene with an empty object and single-state FSM with just the one action. I'm thinking this must be a project setting somewhere that I've totally forgotten about, or perhaps something changed with "every frame" actions in a newer version of Unity? Both scripts are a few years old but they've worked for me previously.

I've tried un-checking "Control Mouse Cursor" on the PlayMakerGUI object, but no luck there. Any ideas what I might be doing wrong?

"Get Mouse Position" [http://hutonggames.com/playmakerforum/index.php?topic=5862.0 (http://hutonggames.com/playmakerforum/index.php?topic=5862.0)]

"Get Mouse X and Y"  [http://hutonggames.com/playmakerforum/index.php?topic=1644.0 (http://hutonggames.com/playmakerforum/index.php?topic=1644.0)]
Title: Re: "Get Mouse ___" actions not running every frame
Post by: Breadman on November 29, 2016, 07:45:15 PM
I was able to workaround by unchecking "every frame", and then passing the FSM to a "wait" state with a "wait" action set to .01 seconds, and then back to the "get mouse position" state. Not ideal by any means, but perhaps a clue as to why the "every frame" option isn't working for me?
Title: Re: "Get Mouse ___" actions not running every frame
Post by: jeanfabre on December 01, 2016, 02:47:00 AM
Hi,

 very odd. Are you sure nothing actually calls finish or a transition of that state?

 I would try on a fresh project first to guarantee it's not the action itself.

 Bye,

 Jean
Title: Re: "Get Mouse ___" actions not running every frame
Post by: Breadman on December 12, 2016, 06:02:58 PM
I'm still encountering the issue in a new project. On a separate computer, I've created a new project folder with a fresh import of PlayMaker. I put Lane's "Get Mouse Position" (with "every frame" enabled) on a one-state FSM attached to an empty object. At runtime, the variable updates quickly two or three times, and then stops updating.

For good measure, I  put a "Finish" event on the state and attached it to a second, empty, state (just to see if for some reason the action is marking itself as "finished" even though "every frame" is checked). The FSM never transitions to the second empty state, so the action still thinks it's running.
Title: Re: "Get Mouse ___" actions not running every frame
Post by: jeanfabre on December 15, 2016, 04:03:50 AM
Hi,

 can you send me that project, I'll see if I have this locally too and see where things go wrong.

 Bye,

 Jean