playMaker

Author Topic: [solved] How to detect "no user interaction" with playmaker ?  (Read 3077 times)

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
[solved] How to detect "no user interaction" with playmaker ?
« on: September 06, 2013, 07:15:37 PM »
I want to know if I can make a system with playmaker that If user doesnt press a hardware button or not execute any FSM  for a specific amount of time to get back to main menu....

Any help will be appreciated.

Best regards.
« Last Edit: September 07, 2013, 08:08:27 PM by cmvrgr »

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: How to detect "no user interaction" with playmaker ?
« Reply #1 on: September 07, 2013, 05:36:05 AM »
Hey there.
 
Just set up an FSM on an empty Gameobject with a Wait and Any Key action. Create a float variable for your time limit and hook it into the Wait action.

When the Any Key action detects a key press, fire off the Reset Timer event and reset the time limit variable, and if nothing is detected have the Wait action Finish event fire off the Shutdown event to return to main menu.

You could flesh it out quite easily too. For example you could make the time limit a global and have certain state machines reset the timer, or you could watch the input axes and mouse to have them reset the timer also.

Hope this helps :)
« Last Edit: September 07, 2013, 08:44:42 PM by uberwolfe »

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
Re: How to detect "no user interaction" with playmaker ?
« Reply #2 on: September 07, 2013, 06:12:47 PM »
Nice....  :D

Thank you for your help..... I will try it right away  :)

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
Re: How to detect "no user interaction" with playmaker ?
« Reply #3 on: September 07, 2013, 06:32:10 PM »
Works perfectly... do you have an idea on how I can track mouse X,Y movements that will reset the timer ?

Thanks

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: How to detect "no user interaction" with playmaker ?
« Reply #4 on: September 07, 2013, 07:57:29 PM »
Hi. Use the Get Mouse X or Get Mouse Y action and map the result to a float variable. You could track both but realistically tracking only one will do.

Then use the Float Changed action with your variable to check if the mouse position has moved and fire off the Reset Timer event as needed :)
« Last Edit: September 07, 2013, 08:03:22 PM by uberwolfe »

cmvrgr

  • Junior Playmaker
  • **
  • Posts: 64
Re: How to detect "no user interaction" with playmaker ?
« Reply #5 on: September 07, 2013, 08:08:03 PM »
It worked perfectly  :D

I would like to thank you for helping me out..... :)

uberwolfe

  • Junior Playmaker
  • **
  • Posts: 59
Re: [solved] How to detect "no user interaction" with playmaker ?
« Reply #6 on: September 07, 2013, 08:41:44 PM »
You're welcome!  ;D