Im working on Breakout/arkanoid clone & would like to know is it possible to detect exact spot where the collision occurred on an Area2D with CollisionShape2D with rectangle shape. There is two places where Id like to know it.
First is when the ball strikes the tile from the side, Id like to switch balls direction.x on the other side. Currently it only works correctly for top or bottom collision where it doesn't matter is it ball above or below the tile when I switch the direction.y it will go as it should.
Second place is the paddle where Id like to know where on the x axis of paddle the ball is colliding. So if it hits the middle Id like to have it bounce straight up, if it its more to one side it would get more angle to that side.
I couldnt find anything on that in properties or by searching net. The solution might be comparing position of the ball with the position of tile & paddle, but I though it might be something in the engine already.
What if I had the player & would like to know where the bullet hit players body? How would you solve that?