Hi,
I also work on a platformer, though nowhere near similar to Celeste. If you want a specific platformer and keep it at that, there are already scripts out there that do this nicely, for instance (this project is on Github, link at the video).
There are already several platformer-specific assets. I thought that the
Rex Engine looks good for this.
I write this, because I am just barely through the thicket of core mechanics and I found that especially walljumping and ledgegrabbing are an absolute nightmare with PlayMaker (don't get me wrong, I love PlayMaker, but this is unusually difficult, but somehow easier with scripts). I was tempted several times to call it off and do the entire core with scripts. But I didn't do it, because I wanted to keep it open for expansion. But if I was making a platformer like Celeste, I would straight just buy a platformer asset, and use my time on building cool, and challenging levels.+
With that being said: here is how I do the ground checking:
An alternative I consider(ed) is using an overlap sphere. But for now this works for me.
I use a Capsule Collider 2D (with fixed z), and three rays. If you work with 2D physics, you must always use the corresponding 2D actions. In this case
Ray Cast 2D. I use the following settings.
Almost everything none. Direction Y -1 for downwards. The others with x 1 (right) and -1 (left). My offset is x 0.3 and -0.3, and Y 0.1. I store the Hit, and check every frame and use a Layer Mask. Simply set your ground or level geometry to this layer (called "Level" in my case), and have it check for that only.
Make sure that all of the rays return a
different bool. E.g. Ground Center Detected, Ground Right Detected, Ground Left Detected. Then, use an action like Bool Any True, or Bool None True to combine the different bools into a clear "Grounded" bool.
To fiddle with the values, set a debug color and Debug to true. Put your character into the air. Set the Rigidbody2d to "static" and then play. This makes it so that you can tune the rays to your situation unti they fit nicely. And once you're satisfied, set the Rigidbody2D back to dynamic.