I am making a 2D platformer and I’m having trouble making the player be able to jump. How can I make my player detect when he’s on the ground so he can jump? How can he detect when he lands on ground after jumping for a landing animation?
There are generally two ways to do this. You could attach Colliders on the feet of your character and use them as triggers, checking when they intersect with the floor. Or, you could use RayCast2D to find out how far away the floor is from the feet of your character (by casting rays downward from their feet).