Any way to prevent player from getting stuck where two one-way collision chunks are side by side?

Godot Version

v4.6.1.stable.official [14d19694e]

Question

When I jump into one-way tiles but not high enough to actually land on them, if it’s a point where the tiles split off into another chunk, this happens:


The framerate won’t allow it but he’s shaking even more crazily there.

How do I fix this? I was thinking something about grouping tiles differently, but I have no idea how to do it and if it’s even possible. Maybe there are better ideas?

Are you using move_and_slide()? I’m not sure what would cause this issue, but if you’re using move_and_slide() then increasing the maximum number of “slides” with set_max_slides(value: int) may help. The default is 6.

nope, still not working

Okay, so it most likely has to do with me using a weird collision setup that involves switching between a rect and a downward-facing polygon so I can have Mario-like behavior on blocks but Sonic-like behavior on slopes. I have no idea how to fix something like that tho.

Yeah, I wouldn’t know how to fix that. Only thing I can suggest is maybe displaying which state the player is in or outputting it as a print() would tell you if the game is putting your player into the wrong state.

That, or you have the movement modes be a manual toggle, so it’s up to the player which they use.

1 Like

Okay so I added an area2d (of which my player scene already has an awful lot but like sure whatever let’s add one more) that keeps track of whether I’m currently overlapping a semisolid or not. Then if it returns true, I switch to the rectangular collision so that it doesn’t try to cling to the side of the split chunk or whatever it’s doing. Not the best solution, but it works and that’s all that matters to me

Also it somehow fixed this thing to an extent

idk if I should mark this as the solution, seems more like a hack than an actual solution