Question by
unity_vpIHY7yQnLJ1LQ · Feb 12, 2020 at 11:36 PM ·
androidtouchtouch controlsdouble jump
Android Touch Double Jump - Not working
Hi everyone. I´m having trouble making my double jump logic work using the Touch commands.
Here is my piece of code:
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began && _grounded == true)
{
_rigid.velocity = new Vector2(_rigid.velocity.x, _jumpForce);
jumpCount++;
if (jumpCount < 2 && _grounded == false)
{
_jumpForce += _jumpForce*2;
}
if (_grounded == true)
{
jumpCount = 0;
}
}
I´m pretty new around, so it would help me a lot to understand what i´m doing wrong.
Thanks in advance!
Comment
Your answer
Follow this Question
Related Questions
When The Screen Is Touched Jump 0 Answers
Android Controls 1 Answer
touch.position values clearification 0 Answers
Why is my multi touch not working? 1 Answer