Player can't jump into the corridor but can fall into

Godot Version

v4.1.3.stable.official [f06b6836a]


The Player collision box is 32x59, CharacterBody2D Safe Margin is 0.001;
Every tileset block 64x64.

I have made a gap between blocks and am trying to jump into it but when I am hugging the wall I can’t get through:

When I am falling down it is fine:
https: [slash][slash] [slash] 3o1oKFH2KHg

Basic movement script:
player.velocity.x = player.WALK_SPEED * input_direction_x
player.velocity.y += player.GRAVITY * delta

Anyone got any clues how to solve this conundrum?

Just make the collision box smaller, there’s no reason to make it exactly the size of the corridor, right?

It is already at 59px while the gap between the blocks is 64px and yet it still doesn’t squeeze through when I try to jump into it. I also thought about shrinking the player collision box and yes it would work, but I thought that perhaps there was a better, less hacky way to solve it where I could keep the collision box the way it is or even increase to 63px.

When I made my own collision detection fo a character like this I only checked 8 points, not even a rect, to figure out all the collision. Four checks on the middle of each side first, then the corners if all those had no collision. This is just to tell you how fake it can be while still feeling correct. Do not worry about how correct it IS, but about how it FEELS.
You could make the box much smaller than the character and just check the feet for standing on things and the head to prevent jumping in a corridor.

Thanks, I’ll play around with your suggestions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.