This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

How can I handle stepping up a small obstacle using Kinematic2D based movement? I'm using MoveAndSlideWithSnap() for the movement. I'd prefer an answer based in c# but GDScript is fine as well.

in Engine by (61 points)

1 Answer

0 votes

What exactly do you mean by "small obstacle"?

If you have an uneven surface and your rectangular collider is getting hung up on small bumps, etc., what many games do is add a rounded collision shape at the feet of the player, allowing it to "glide" over them.

by (22,191 points)

It would be too large to just glide over with rounded edges though that is something I've going to do. They would be things like real stairs, sure I could turn it into a slope but physics objects like a ball would behave differently. I'm also using a tile system and want to be able to walk up 1 tile without jumping.

couldn't you make the stairs have a slope collision for the player, and a stair step collision for the ball? That could be done with collision layers couldn't it?

@Millard I guess if there's no other way, doing that with autotiles will be awful though

You never mentioned you were using autotiles. that could be tricky, to say the least. :[

I didn't really think it would be relevant, I'm thinking about using raycasts to do it instead

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.