- Home /
OnDrag or OnPointerUp Method are sometimes not called when tapping
hello I don't speak English, so I'm worried if it will reach you. sorry
Left screen: Operation of player
Right screen: Camera operation
The following scripts are attached to each.
public class Test : MonoBehaviour, IDragHandler, IPointerUpHandler, IPointerDownHandler
{
public Boolean testPressed;
private void Update() => Debug.Log(testPressed);
public void OnDrag(PointerEventData eventData) => Debug.Log("ドラッグ中");
public void OnPointerUp(PointerEventData eventData) => testPressed = false;
public void OnPointerDown(PointerEventData eventData)
{
OnDrag(eventData);
testPressed = true;
}
}
Conditions for problems to occur
Tap the left screen with your first finger
Operate the camera with your second finger
Release your first finger.
I released my first finger. Second finger haven't let go OnDrag() and OnPointerUp() method Will not be called
that's why testPressed was supposed to be true only when tapped, but testPressed remains true because OnDrag () and OnPointerUp () are not called when this issue occurs.
Comment