2DPlatformer-Tutorial icon indicating copy to clipboard operation
2DPlatformer-Tutorial copied to clipboard

Collision detect is not right

Open ghost opened this issue 8 years ago • 1 comments

untitled

ghost avatar Mar 29 '17 12:03 ghost

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.

preview

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.

Falconerd avatar Apr 15 '17 06:04 Falconerd