playMaker

Author Topic: Character controller speed [SOLVED]  (Read 3003 times)

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Character controller speed [SOLVED]
« 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?
« Last Edit: March 14, 2012, 01:18:31 AM by Alex Chouls »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Character controller speed
« Reply #1 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

Bye,

Jean

tim.holman

  • 1.2 Beta
  • Playmaker Newbie
  • *
  • Posts: 49
Re: Character controller speed
« Reply #2 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