En este momento estás viendo IsPointerOverGameObject.  No pude calibrar correctamente

 – Unity

IsPointerOverGameObject. No pude calibrar correctamente – Unity

IsPointerOverGameObject. No pude calibrar correctamente

– UnityAssets3Free

bienvenido , soy Juan y en esta ocasion os traigo
esta unity pregunta

Hice que el juego no se iniciara cuando presioné los íconos de la interfaz de usuario en la pantalla de inicio del juego. Sin embargo, esta vez el juego no se inicia cuando presiono cualquier área que no sean los íconos de la interfaz de usuario. Probé las soluciones que encontré en la web. Tardé 2 días. Lamentablemente no obtuve ningún resultado. ¿Me estoy saltando algo? ayuda por favor.

private bool speedBallForward = false;
private bool firstTouchControl = false;

public void Start()

    rb = GetComponent<Rigidbody>();


public void Update()

{
    if (Variables.firstTouch == 1 && speedBallForward == false)
    
        transform.position += new Vector3(0, 0, forwardSpeed * Time.deltaTime);
        cameraFollow.transform.position += new Vector3(0, 0, forwardSpeed * Time.deltaTime);
        vectorBack.transform.position += new Vector3(0, 0, forwardSpeed * Time.deltaTime);
        vectorUp.transform.position += new Vector3(0, 0, forwardSpeed * Time.deltaTime);
    

    if (Input.touchCount > 0) 
    
        touch = Input.GetTouch(0);

        if (touch.phase == TouchPhase.Began)
        
            if (!EventSystem.current.IsPointerOverGameObject(Input.GetTouch(0).fingerId))
            
                if (firstTouchControl == false)
                
                    Variables.firstTouch = 1;
                    UIManager.DeactiveAfterGameStart();
                    firstTouchControl = true;
                
            
        

        else if (touch.phase == TouchPhase.Moved)
        
            rb.velocity = new Vector3(touch.deltaPosition.x * speedModifier * Time.deltaTime,
                transform.position.y,
                touch.deltaPosition.y * speedModifier * Time.deltaTime);
        

        else if (touch.phase == TouchPhase.Ended)
        
            rb.velocity = Vector3.zero;
        
    
}

0

nota: si aun no se resuelve tu pregunta por favor dejar un comentario y pronto lo podremos de nuevo , muchas gracias

por hoy,espero que te funcione

Deja una respuesta