playMaker

Author Topic: Is there an If function for idle? [SOLVED]  (Read 1202 times)

Micah

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Is there an If function for idle? [SOLVED]
« on: March 19, 2018, 07:04:21 PM »
I have been wondering if there is an "if" function for when the character is idle. (I can't use the animator, so that won't be a solution). So if the charactercontroller is not moving then x = y. Something like that? Kind of like there is an "IF" function for grounded.
« Last Edit: March 25, 2018, 01:48:17 PM by djaydino »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15398
  • Official Playmaker Support
    • View Profile
Re: Is there an If function for idle?
« Reply #1 on: March 20, 2018, 03:33:03 AM »
Hi,

 yes, check the GameObjecr speed and  compare it to less than 0.1, which means it's staying in place.

 Bye,

 Jean

Micah

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Is there an If function for idle?
« Reply #2 on: March 20, 2018, 01:13:48 PM »
What is the name on the action that does this?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5436
    • View Profile
    • jinxtergames
Re: Is there an If function for idle?
« Reply #3 on: March 20, 2018, 01:59:30 PM »
Hi.
I think you are looking for "Float Compare" :)

Micah

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Is there an If function for idle?
« Reply #4 on: March 20, 2018, 02:35:22 PM »
hmmm. I'm not sure. What I am using is Vector3 so how would the float relate to it?
I also coded the movement. I didn't use controller simple move.
« Last Edit: March 20, 2018, 04:08:02 PM by Micah »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 5436
    • View Profile
    • jinxtergames
Re: Is there an If function for idle?
« Reply #5 on: March 20, 2018, 11:22:04 PM »
Hi.
You need to use "Get Speed" , check every frame.
Then use "Float Compare" and also check ever frame.

Micah

  • Playmaker Newbie
  • *
  • Posts: 23
    • View Profile
Re: Is there an If function for idle?
« Reply #6 on: March 25, 2018, 04:50:03 AM »
Thanks!  In the end I used "Get Game Object Speed" from the ecosystem and float compare.

It has worked perfectly.