The sticky situation part 2
This is a follow-up from a previous article talking about Box2D collisions issues.
That was a long time I didn’t post anything. But I have good news. The sticky situation is solved! Alleluia!
The huge mistake I made was that the different shapes were putted together using weld joints. Weld joints were not adapted as the shapes were “floaty”, meaning that the shapes were not strongly attached to each other resulting in disastrous collisions. Not speaking about the joints themselves impossible to manage in the scene and causing bugs.
The solution is not far from the third attempt. But the hitbox was built with the complex body constructor. Here, the different bodies are considered as one body in term of collision, but with different properties. Exactly what I need!
Now, when a side sensor touches a wall, it cancels the hero’s linear velocity in this direction. So the hero’s main body never touches the walls and that prevents the sticky situation!