Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Character falls through floor when falling at high speed #697

Open
ewokdanceparty opened this issue Mar 24, 2023 · 5 comments
Open

Character falls through floor when falling at high speed #697

ewokdanceparty opened this issue Mar 24, 2023 · 5 comments

Comments

@ewokdanceparty
Copy link

ewokdanceparty commented Mar 24, 2023

Hi all, in my game I would like each jump to last 0.25 seconds. The problem is, when I tune gravity and jump speed for that air time, the character sometimes falls through the floor. I would like this not to happen in my game. This appears to be a bug, but maybe there's a way to mitigate this without changing the source code?

To replicate, go to:

On https://3000.kaboomjs.com/play?example=platformer

Set the following parameters:

setGravity(30000)
JUMP_FORCE = 3750

And then try jumping.

(I normally set gravity and jump speed to half those values, but then the character will only occasionally fall through the floor. If I don't set gravity and jump speed to be fairly high, I can't get a jump with a satisfying height that lasts 0.25s).

This appears similar to an issue that was closed in 2021.

Thank you!

@gunikas
Copy link

gunikas commented Apr 15, 2023

I have a similar problem with the play character falling through the ground occasionally. gravity is just set to 3000

@qsun81
Copy link

qsun81 commented Jun 15, 2023

same here. gravity is set to 2000, but my character falls down through the platform.

@dratner
Copy link

dratner commented Jul 9, 2023

+1

@pjoe
Copy link
Contributor

pjoe commented Jul 11, 2023

Seeing this also, toying with a platformer, but when player falls off platform and keeps falling long enough velocity gets high enough (because of gravity) that the player falls right through lower platforms. Is there alternatively a good way to limit the max speed of e.g. a falling player?

EDIT: using ver. 3000.0.14

@ganevdev
Copy link

Seeing this also, toying with a platformer, but when player falls off platform and keeps falling long enough velocity gets high enough (because of gravity) that the player falls right through lower platforms. Is there alternatively a good way to limit the max speed of e.g. a falling player?

EDIT: using ver. 3000.0.14

Here: https://kaboomjs.com/#BodyCompOpt there is maxVelocity param for body - I think with this you can set the maximum velocity that the body can have, drag and gravityScale parameters may also help with this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants