Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: tim.holman on February 28, 2012, 05:48:40 PM

Title: isSliding boolean
Post by: tim.holman on February 28, 2012, 05:48:40 PM
Is there a way to detect if the player is sliding or not? I looked through the properties under Character Motor (Standard Asset) and did not see anything pertaining to sliding. (Oddly enough, doesn't look like there's even an option to enable/disable sliding at run time.)

Basically, what I'm trying to do here is apply damage to the player if he slides down a cliff side. Because the player is still considered to be grounded when he's sliding down the cliff, I am unable to do a Y-position check before and after being grounded. (This is how I'm handling falling damage when not grounded). If I can figure out a way to decipher whether or not the player is sliding, I can simply apply damage while an "isSliding" boolean is true.

Any help/suggestions here would be very much appreciated is I've been struggling on this one for a while!
Thank you!!
Title: Re: isSliding boolean
Post by: jeanfabre on February 29, 2012, 01:10:43 AM
Hi,

 I would start by comparing the input and the speed and direction. If for example the user is not pressing any key and the player has speed, this means he is sliding against its will.

  If the user press "move forward" and the speed direction is not exactly aligned with the forward axis, then the drifting is angle between the speed direction and the forward axis.

 does that make sense?

Bye,

 Jean