Hey,
This is probably a really easy question, but i am new in unity and i cant fixed it. I want to only one touch. if people touch it twice. it becomes 2 touches.
UnityException: Index out of bounds.
can somebody help me?
void Update()
{
Touch touch =Input.GetTouch(0);
if (dead)
{
DCD -= Time.deltaTime;
if (DCD <= 0)
{
if (Input.GetTouch(0).tapCount > 0)
{
Application.LoadLevel(Application.loadedLevel);
VFalse.SetActive(true);
}
}
}
else
{
if (Input.touchCount > 0 && touch.phase == TouchPhase.Began)
didFlap = true;
}
}