Let me just say that I haven’t tested this approach yet because I wrote my own code before watching this video. But it seems like using the isTouchingLayers method has a major flaw, it will allow you to jump while touching the side of the ground, which means you can keep jumping to climb any wall.
The way I did it was to use a raycast pointed down from the player that detects if they are on the ground or not.