Fixed character controller jump height

Hello

I am currently working on a player controller using Unity’s built-in character controller and I would like the jump height to be fixed. Right now I am simply doing “moveDirection.y = jumpHeight;” and it works but it is not really what I want. The jump height is set to 10 and that results in the player jumping ~2 meters up in the air. But how do I make it so, for example, I set it to 3, the player jumps meters into the air?

Any help is appreciated!

i believe the calculation you want is

Mathf.sqrt( 2 * jumpHeight * -Physics.gravity.y );