playMaker

Author Topic: Add Force 2D (Jumping) not responding.[SOLVED]  (Read 6577 times)

Redxlotus

  • Playmaker Newbie
  • *
  • Posts: 6
Add Force 2D (Jumping) not responding.[SOLVED]
« on: May 15, 2017, 06:49:13 PM »
Hello everyone!

I recently got Playmaker to help me out on my project, so i'm rather new to the whole program.

Anyway, I setup the character movement (2D plane) he can walk left and right, animations work and he flips like a pro. If only the same could be said for his jumping skills.

(things I used in the walking FSM: Get axis, get key down x2 and set velocity 2D)

For jumping I added a get button down on one state and on a new state the add force 2d. I added a force of 500 on the y axis  and further nothing. When I press space, I can see the loop working in the editor, but my character just stands there and does not move one inch.

Any ideas what could be the problem?

« Last Edit: May 26, 2017, 06:16:09 AM by jeanfabre »

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Add Force 2D (Jumping) not respoding.
« Reply #1 on: May 16, 2017, 08:04:51 AM »
can you take a pic of your 2 states that loop with key down so we can see what the actions are set up as

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Add Force 2D (Jumping) not respoding.
« Reply #2 on: May 16, 2017, 08:31:25 AM »
Does the object have a rigidbody?
Available for Playmaker work

Redxlotus

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Add Force 2D (Jumping) not respoding.
« Reply #3 on: May 16, 2017, 11:13:57 AM »
@ Krmko: Yes, my object does have a Rigidbody, but the 2D one. I added apicture with the settings!

@HeathClose: Here you go!

First it thought might be something to do with Anima 2D, but when i set up a new project and just made a simple image with the same playmaker code it just did not want to jump either.

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Add Force 2D (Jumping) not respoding.
« Reply #4 on: May 16, 2017, 11:35:05 AM »
Did you try using debugging to see what the console has to say? Also, try using get owner action and saving the object under a game object variable, then reference the variable in the add force action.
Available for Playmaker work

Ofonna

  • Full Member
  • ***
  • Posts: 230
Re: Add Force 2D (Jumping) not respoding.
« Reply #5 on: May 16, 2017, 12:53:50 PM »
disable all other FSMs including the animator component and try again. there might be something you're doing every frame that's keeping your player game object in one position

Redxlotus

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Add Force 2D (Jumping) not respoding.
« Reply #6 on: May 16, 2017, 05:16:50 PM »
Ok like what the actuall what... xD

After messing around a lot... and adding the get owner to the fsm it was still not working.

Then I tried adding more force to Y(mind you, a lot of videos showed values as low as 250 for jumping), I thought I already had it quite high so I dismissed that as the problem. It seems I was wrong. Adding a force of 20000 seems to make the character hop a bit. Only after bumping it up to 70000 I have it jumping the amount I want..

How can this number be so high!!!?

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Add Force 2D (Jumping) not respoding.
« Reply #7 on: May 16, 2017, 05:22:32 PM »
Try lowering your gravity scale.
Available for Playmaker work

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Add Force 2D (Jumping) not respoding.
« Reply #8 on: May 17, 2017, 02:41:05 AM »
Hi,

 maybe you have added some drag to your rb? it does affect the force required to move things.

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Add Force 2D (Jumping) not respoding.
« Reply #9 on: May 17, 2017, 02:56:33 PM »
just change force to impulse... done

and you can lower your number now.. like to 5
« Last Edit: May 17, 2017, 02:58:22 PM by HeathClose »

Redxlotus

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Add Force 2D (Jumping) not respoding.
« Reply #10 on: May 23, 2017, 04:55:44 PM »
Everything works just fine now =D!

Thank you everyone for the responses!

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Add Force 2D (Jumping) not respoding.
« Reply #11 on: May 23, 2017, 05:19:31 PM »
Or you can use Set Velocity. I always use that for jumping.
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

Redxlotus

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Add Force 2D (Jumping) not respoding.
« Reply #12 on: May 25, 2017, 07:32:03 PM »
@Rabagast

Nice suggestion, thanks! It seems to take more normal values than the add force 2D. Tried lowering the values, but it still needed values over the 10000 to achieve liftoff :P

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Add Force 2D (Jumping) not respoding.
« Reply #13 on: May 26, 2017, 08:25:47 PM »
@Rabagast

Nice suggestion, thanks! It seems to take more normal values than the add force 2D. Tried lowering the values, but it still needed values over the 10000 to achieve liftoff :P


10000? Even if you use Set Velocity? I use maybe 20 or something. It's very strange that you need that high value.

If you go to Project Settings/Physics, what value do you have to the gravity?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: Add Force 2D (Jumping) not responding.[SOLVED]
« Reply #14 on: May 27, 2017, 07:27:48 PM »
I've been through all this, too.  The only time I get a jump out of anything is if I use impulse...