I’m experiencing an issue with touch input in my Android build :
In Editor (with Remote Test): Touch input on the phone works only after a single click on the game screen with the mouse.
On Android Build: Touch input doesn’t respond on the device.
using UnityEngine;
using UnityEngine.EventSystems;
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
using TouchPhase = UnityEngine.InputSystem.TouchPhase;
public class test : MonoBehaviour
{
public void Update()
{
if (Touch.activeTouches.Count == 1)
{
Touch touch = Touch.activeTouches[0];
if (!EventSystem.current.IsPointerOverGameObject(touch.touchId))
{
// Touch moved phase
if (touch.phase == TouchPhase.Moved)
{
Vector2 deltaPosition = touch.delta;
Camera.main.transform.localEulerAngles += new Vector3(Mathf.Clamp(deltaPosition.y * Time.deltaTime, -9, 9), deltaPosition.x * Time.deltaTime, 0);
}
}
}
}
}
did i miss something?