2DPlatformer-Tutorial
2DPlatformer-Tutorial copied to clipboard
Collision detect is not right

EDIT: Turns out #9 came to the same conclusion as below with sample code
You can fix this by casting more rays with horizontalRayCount in RaycastController.cs.

However, this wouldn't be the solution I would use.
I would cast a ray from the bottom left corner directly to the right, traveling the length of the player - skinWidth.
If there is a hit and the object is within the bounds of the player, I'd move the player to the highest point of that object.
That's just an idea and untested. Perhaps there's a better way.