+1 vote

For my game, I wanted a collision system that can allow characters/enemies to walk up or down slopes and do wall jumps.

I looked at the Godot platformer demo and while it does work...it does not have that "sharp" platformer feeling at all; the jumping and walking felt "floaty" and weird (in a bad way).

So I had a look at Kinematic Bodies for characters and I managed to create a playable character with one.

It had the "sharp" feeling with everything except wall jumps. My character just sticks to the wall or is able to jump up the against the same wall he/she jumps off of (which is a mechanic I don't want).

Now I am considering using the Area2D nodes to detect the collisions then and use GDScript to handle collision responses.

One for the feet - to detect the ground.
And a few for the character's sides for slope and wall detection, so wall jumping conditions can be detected.

Is there anything, I should consider when using multiple Area2Ds for character collision detection and collision response.

  • Like the performance because in the documentation, it said that contact reporting was memory intensive. (What happens if lots of objects go into one character?).
  • ...or sweep tests
in Engine by (18 points)

1 Answer

+2 votes

Have you looked at kinematic character demo? it has a simple controller that works fine.
If using the development version, the new platformer demo has a kinematic controller too.

For the question, the walls can be worked with collision normal checks after move, colliding and checking if colliding with a wall (all Kinematic methods to use after move).

If you want extra proximity checks (or limit contact points), Raycast2D could be better than area too, is simple to work with them.

ps: Also, think on working with a state machine because adding more features can give some headaches with normal approach later.

by (7,946 points)
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.