Ignore collision in certain condition

Hello everyone,

I am trying to make a 2d game a bit similar to “Doodle Jump” so in general i want that the player collide with platforms only if he is falling, i didn’t find anyway to do it except using different layers and ignore the collision when the player Y velocity is greater than zero (going up)
theoratically this seems to work and it did works, but sometimes it doesn’t, it’s a very annoying bug that am trying to solve with no luck at all.
You can try the game on your browser here
i don’t think some code will be helpful for now since it’s more than a theoretical question, thank you

okay so i fixed the problem by doing some extra “cheat” in the game, i used 2 childs inside the player object, one for the feet collision and the other for the body collision, the body object ignore the ground and interact only with walls and other game element, and for the feet object, i made it that its boxCollider get disabled when the parent velocity is greater than zero and re-enabled when it’s less than zero.