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