- Home /
clicking on button while moving on andriod
so i'm making a car racing game on andriod and when i press the turbo(boost) button my car keeps moving to the direction i'm clicking , i'm trying to press the button without detecting the input of mouse(touch) position
if (Input.GetMouseButton(0) && !isClicking)
{
if (Input.mousePosition.x > Screen.width / 2)
{
moveVector.x = 10;
if (playerTrasform.position.x <= 3f)
{
playerTrasform.transform.Rotate(0.0f, 0.0f, -0.30f);
}
}
else
{
moveVector.x = -10;
if (playerTrasform.position.x >= -3f)
{
playerTrasform.transform.Rotate(0.0f, 0.0f, 0.30f);
}
}
}
and i tried !EventSystem.current.IsPointerOverGameObject()
Comment