I’ve been looking around for the best way to get ground checks to work - so far I’ve got the following methods:
onCollision methods, BoxCast,OverlapBox/Circle etc.
Of all these, onCollision’s the easiest but I read elsewhere it may be problematic for tight controlling platforming.
BoxCast seems to be complicated to visualize properly (I just can’t figure out how to get it to detect ceilings), and OverlapBox seems to be the best one of all - but I just can’t get the angle to calculate since the resulting collider2D does not have a normal attribute.
What’s a good approach here? There’s a lot of tutorials talking about overlap methods but fail to mention how to handle walls/ceiling detection. It’s real easy when you’re just detecting a single layer type ground but I am using a single tilemap on a single layer and I think the correct way is to detect the surface angle based on the player’s transform.