Jumping on top of an enemy problem

Hello, I have a Player parent object with a character controller and various child objects and a similar enemy with a box collider.

I’m struggling to differentiate between the collision happening when the player walks into the enemy and when the the player jumps and collides with it from above.

I’ve tried tagging the child objects but they don’t have colliders and if I add them it messes up my character movement. I’ve also tried to test the position of the player:

if(col.transform.position.y >= transform.position.y){

But this doesn’t work either - should I add the height of the enemy? If so how do I do that?

Any suggestions happily received.

You have to use OnTriggerEnter function to jump on enemies.