I’m using Nez physics and I have a velocity variable that moves the characters every frame. In order to avoid moving into another collider, it applies the velocity to the colliders attached to the first character and checks if they intersect with any other colliders, if not it just moves. If there is an intersection at this new position it finds the minimum translation to apply to the first collider in order to move it away from the other and subtracts that from the motion.
The problem is that this minimum translation might move it away from one collider, but if it moved it straight into another it’s useless. The way this can happen is for example if the character is falling down at a high speed and falls down on some tiles, the distance it will move into the ground on the y-axis might exceed the distance it will take to move it to the next tile on the x-axis. How can I take the surrounding colliders into consideration?