Hi!
We're developing a 2D one-button platformer. The player’s character runs forward all the time, and pressing a key makes him jump. It's not an endless runner, though. When the player collides with a wall, it turns over and continues running in the opposite direction. After a lot of developing and testing, we’ve detected some bugs in our collision system (we’re using Unity).
Our character has a 2D circle collider. We have different types of rectangle colliders in the levels: walls to turn around, ground to let him jump when he’s standing on it and default to just don't let him pass through, used mainly in ceilings. Sometimes, because of the constant player movement, the character collides with more than one type of collider, for example in wall-ground corners. Using other kinds of colliders for the player (rectangles and so) makes the problem even worse, since hard pointy edge intersections tend to get stuck in places.
Talking about coding. We’re using the Physics2D.IsTouchingLayers() to detect the ground and the wall.
So, we're interested in the community point of view. How would you make this collision nightmare work? Any clues, alternatives or possible solutions?
Thanks!