Hi there! Im making a 2D engine with collisions and the problem is, i need to know from which side did the object collide!
Here are some examples!
We have a player, who is a circle, and a rectangle which is gonna be the building.
The game works the way that not the character moves, but the objects!
We are pressing the MOVE LEFT button and the objects of course move right
The object bumps into the player
And I want the objects to move back, as that’s how collision works! But I need to identify from which side did the square bump into the object, right, left, up or down? How do I do that?
This is not a platformer, this is an open world game!
p. s. sorry if I didn’t explain properly, if I didn’t please tell me