Extra Hit Checking

I want to make it so that if you press the jump button just before landing on an enemy’s head it will do extra damage, so I figure that you should have to be: Pressing the Key (not holding it), a little way above the enemy, and moving downwards. This block of code should do it I would think, but it still turns on even when I’m moving upwards. I don’t think I’m using rigidbody.velocity correctly… Any thoughts?

if (Input.GetButtonDown("Jump")  hero.transform.position.y <= transform.position.y + 1.2  hero.rigidbody.velocity.y < 0) {
		actionCom = true;
	}

Nothing in that code looks wrong to me, so either all of those conditions are being met or actionCom is being set to true elsewhere.

I would put in a Debug.Log() within the conditional to see what velocity.y was as well as the to position.y was for each transform.

You set actionCom to true if … but when do you set it to false?
Maybe you should do

actionCom = (Input.GetButtonDown("Jump")  hero.transform.position.y <= transform.position.y + 1.2  hero.rigidbody.velocity.y < 0);