Jump Actuation

I’m trying to implement a system where my code is able to detect when the player has touched the floor after jumping and now does not jump. The way I have it right now is that the player can only jump when hes on ground (I want to keep this way). Basically if the player hits the ground and doesn’t time his jump key stroke properly with when the character hits the ground and isn’t able to jump I want some other code to run. However if the player hits the ground and does time his jump key stroke properly and jumps as soon as hits the ground some other code should run. I want a system to be able to detect whether he has hit the ground and not jumped AND whether he has hit the ground and has jumped at the same instant. My if statements aren’t working because Im using grounded as a condition which obviously is going to be true whether or not he times the jump properly.

Any help is appreciated.

@FShiwani,

what im gettiing is that you want the player to jump right as he hits the ground and not to late after he hits the ground.

Maybe when you use an IF statement you could set a coroutine(coding timer) to end in a short period of time and when the coroutine ends the character.ProperStrokeTime would equal false but if he jumps during that time the character.ProperStrokeTime would be true

if the character is not touching the ground the character.ProperStrokeTime would be true by default

so 
if(character.IsGrounded == true)
startcoroutine("blahblahblah");

// IEnumerator is a corotine, it does whatever than waits when you do a yield return 

IEnumerator blahblahblah(){

yield return new WaitForSeconds(0.4f){
character.ProperStrokeTime = false;
}
void otherFunc(){
if(character.IsGrounded == false)
character.ProperStrokeTime = true;
}