"power" "kick" "force" bar?

say if i wanted to kick a ball with power settings poor,average, and great kicks. i assume i would use booleans for their respective names. but i also have a button you have to hold down and that bar goes up and down while the button is held. i also assume i would have lines (on the bar) to “show” where each “power” would be (eg: start of slider to first line is poor, first line to second line is average, and second line to end of slider would be great). my question is, how would the game know if i landed between the 2 number values of the slider? (eg: 0-0.25 is poor, 0.25-0.50 is average, 0.50-1 is great (i know thats not how any sane person would code those numbers but for the sake of the question)) how would i code this?

The bar has to have a percentage (0-100) or a float value (0.0-1.0) depend on where the bar will be as long as u push the button. You can use that value to determine the power of the kick.

Are you using rigidbody.addforce to kick the ball? If so then you’ll also just need to match the addforce number with the bar that you create.

Use a UI Slider for the display bar. Use Mathf.PingPong to bounce the value between 0 and 1 while the key is down. On key up, grab the value and map it to whatever scale you want.