playMaker

Author Topic: Using Add Force to make a character jump  (Read 8976 times)

dmitry

  • Playmaker Newbie
  • *
  • Posts: 2
Using Add Force to make a character jump
« on: April 08, 2012, 08:12:39 PM »
Hello,

I'm trying to make a simple character controlled by keys. I've created a sphere and made FSM for walking like in tutorial.

Next thing I want to do is to make it jump by Space key. I've added new FSM and made 2 states: Waiting for Jump and Jumping. Added Get Button Down action and that works fine.

Now I'm trying to add Add Force action to Jumping event and set value to Y as 10. I also added Rigid Body component to my sphere. But it doesn't work!

What am I doing wrong?

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Using Add Force to make a character jump
« Reply #1 on: April 10, 2012, 01:57:03 PM »
If you are using a character controller on your player, then it is overriding your ability to add force to your players movement.

instead try adding a "platform input controller" or a "third person character controller" along with your character motor component to your player and then you're JUMP input will start working.

you can tweak the height of the jump etc, in the character motor action within playmaker.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Add Force to make a character jump
« Reply #2 on: May 09, 2012, 05:52:29 AM »
hi,

 I released a playmaker port of the jump game c# examples from M2H. so you can see how It uses the add force action.

https://hutonggames.fogbugz.com/default.asp?W880

Bye,

 Jean

justifun

  • 1.2 Beta
  • Sr. Member
  • *
  • Posts: 280
Re: Using Add Force to make a character jump
« Reply #3 on: May 09, 2012, 10:40:10 AM »
Wicked thanks Jean!

Out of curiosity (im away from my dev machine right now)....does setting the velocity to 0 (and perhaps gravity to 0) on a character controller which is mid jump effectively  make it hover in mid air?


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Using Add Force to make a character jump
« Reply #4 on: May 09, 2012, 11:34:27 AM »
Yep.