Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: tim.holman on March 06, 2012, 05:37:01 PM

Title: Character controller speed [SOLVED]
Post by: tim.holman on March 06, 2012, 05:37:01 PM
I've been trying to figure out a way to deal damage to the player if they are sliding down a steep cliff. Because the cliff is still part of my terrain, the player is still considered grounded when sliding, which has caused a few problems for me. I've decided it might be best just to set the sliding speed higher than my max character controller speed (or downward gravity speed for that matter), then deal damage once the character speed reaches it.

To boil it down for you, all I need to figure out is a way to detect my character controller's current speed! I can't use the getSpeed action, since it requires a rigidbody, and my controller doesn't have one. I've poked around the character controller and motor, but couldn't figure out a way to get the actual speed in real time. I'm guessing there's a simple way to do this that I'm just overlooking?
Title: Re: Character controller speed
Post by: jeanfabre on March 07, 2012, 03:06:52 AM
Hi,

 Here is an action to get the speed of any gameObject. This should work for your purpose.

http://hutonggames.com/playmakerforum/index.php?topic=1182.0 (http://hutonggames.com/playmakerforum/index.php?topic=1182.0)

Bye,

Jean
Title: Re: Character controller speed
Post by: tim.holman on March 07, 2012, 12:45:31 PM
Awesome, thank you! Haven't yet tried it, but looks like that's exactly what I needed. Thank you very much Jean!
~Tim