playMaker

Author Topic: How to recognize "Idle" [SOLVED]  (Read 2843 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
How to recognize "Idle" [SOLVED]
« on: October 17, 2011, 06:51:03 PM »
I'm trying to set up an idle animation and audio clip to be played ONLY when the player hasn't moved the mouse or pressed any buttons or keys for at least 60 seconds. The only solution I've figured out so far is to get the amount of time in the current state, then compare that value to 60, and send an event to another state if that value is equal or greater than (60). The only problem is, the player can remain in the same state while moving around (in other words, they're not actually idle). How do I detect if the player has not had any input for over a given time, then send an event if true?
« Last Edit: November 05, 2011, 02:59:32 PM by alexchouls »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: How to recognize "Idle"
« Reply #1 on: October 17, 2011, 08:42:08 PM »
You could have the Idle State transition to another state on an AnyInput event, and have multiple actions send the AnyInput event to cover all the types of input you want to detect.

E.g., Any Key catches mouse buttons and keys. Get Axis and Float Compare could detect mouse or controller movements. etc.

Or you could combine these actions in a custom action called Any Input...

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Re: How to recognize "Idle"
« Reply #2 on: October 18, 2011, 12:23:32 PM »
Thank you for your help again Alex, works great!