Problem with Rigidbody.AddForce on Android

I’m having a problem with my Player jumping.

I use a piece of code that works when I test it in Unity, but on my Android Phone sometimes too much Force is added to the Player, and because of that my character jump way up, out of the screen.

This is my code that is located in Update()

grounded = Physics2D.OverlapCircle (GroundCheck.position, groundRadius, whatIsGround);
if(grounded && (Input.touchCount > 0) && controlEnabled) {
			GetComponent<Rigidbody2D>().AddForce(new Vector2(0, jumpForce)); 
			
		}

“grounded” is used to check whether the player is standing on object that he can jump from.

I hope some one can help me with this problem, since I’m just starting out :smiley:

Well the problem is clearly with variables of your OverlapCircle function. You just AddForce multiple times for a few frames while OverlapCircle reports overlapping.

You can either adjust those values (most likely just groundRadius) or add some sort of “Jump cooldown” which you can implement either by using Coroutine+WaitForSeconds or Time.deltaTime.