I have a 2d platformer game where my slope can be set at any angle, so I've setup a middle raycast that points to the ground onto the player to handle the collision. This works perfectly fine on a flat platform, but when I rotate it to a slope the player is offset increasingly more.
Player falls onto the platform with no rotation (works fine).
The player falls onto a platform at an angle with no rotation on the player.
Then when I rotate the player to the angle of the platform.
As you can see the player is offset wrong. Do I have to rotate the rays attached to the player and then push him out of the platform? Or is this overkill and I'm doing something wrong?