Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Micah on March 19, 2018, 10:04:21 PM

Title: Is there an If function for idle? [SOLVED]
Post by: Micah on March 19, 2018, 10: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.
Title: Re: Is there an If function for idle?
Post by: jeanfabre on March 20, 2018, 06: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
Title: Re: Is there an If function for idle?
Post by: Micah on March 20, 2018, 04:13:48 PM
What is the name on the action that does this?
Title: Re: Is there an If function for idle?
Post by: djaydino on March 20, 2018, 04:59:30 PM
Hi.
I think you are looking for "Float Compare" :)
Title: Re: Is there an If function for idle?
Post by: Micah on March 20, 2018, 05: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.
Title: Re: Is there an If function for idle?
Post by: djaydino on March 21, 2018, 02:22:04 AM
Hi.
You need to use "Get Speed" , check every frame.
Then use "Float Compare" and also check ever frame.
Title: Re: Is there an If function for idle?
Post by: Micah on March 25, 2018, 07:50:03 AM
Thanks!  In the end I used "Get Game Object Speed" from the ecosystem and float compare.

It has worked perfectly.