How do I apply a force to a platformer character?


#1

I’m trying to implement my own way to do varied height jumps since the current “jump sustain time” property in the current platformer character behavior is, frankly, awful. To do that, I needed a way to apply a force to a platformer character. I’m trying to find a way to do that, but so far that seems impossible. You can apply a permanent force, but that’s using a force completely outside how the platformer character behavior handles movement. This means whatever force I apply will stay like that, and will never be affected by the behavior in any way. So, I tried to find a way to affect the physics of the platform character behavior directly. Now, I found a way to read the current horizontal and vertical speed of the object, but it looks like there is no way to write to those values. Furious googling produced no results either. It looks like the only thing people have done to affect the velocity of a platformer character is in a bounce pad, and that’s just using the regular jump. Is there really no way to affect platformer character velocity? No way to make horizontal bounce pads or anything? That seems like a huge oversight if it’s true.


#2

Have you tried altering the gravity, jump speed and fall speed of the platform character.

If so and that means it didn’t help, you can try moving away from the platform behavior completely.

Try using the physics2 behavior. There is a nice system for simulating jump behavior. You can apply a upwards force combined with a optional diagonal or horizontal force to jump upwards or sideways.

And you can simply use the collision and separate objects to simulate the platform floor.

Ps. Whats nice about the physics2 behavior is that it automatically includes gravity. And physics objects will by default have collision with one another.

Hope this helped.


#3

Did it work? That’s if you decide to use physics. Because like everything else, it has its cons as well. But its the second best thing I could think of.


#4

Physics2 is what I’ll probably end up using. It seems like a shame that the platformer character seems like a “trap” of sorts if you want it to do anything more interesting than jumping and climbing.


#5

Yes, platform behaviors is very restrictive and limited.
If you want things done, do it yourself.
Since the platform behavior is kind of like a already programmed set or commands. Hence behavior.

So yes, I think physics 2 is best.

And from past experience, platform behavior hates vertical movement. :joy:


#6

If you have complaints or suggestions for improvement, be specific. For now, you’re just being rude with the people who worked on this feature.

I’m guessing that you didn’t try, because you’re wrong.

Stop the furious googling and stop the overthinking. GDevelop is a sandbox, play with it, experiment. Trial and error are the best team around.