Hi,
I'm using third person controller with view type 'Third Person Combat'. And target platform is Android.
I made a APK for testing touch controls few days ago and I found that virtual touchpad is working in-correctly.
Let me explain in steps,
1) first drag the finger on touchpad, camera also starts rotating. that is fine
2) now stop dragging the finger and the camera is still rotating. even we don't release finger, camera rotates.
I think, the issues with below code block of VirtualTouchpad.cs script
I'm using third person controller with view type 'Third Person Combat'. And target platform is Android.
I made a APK for testing touch controls few days ago and I found that virtual touchpad is working in-correctly.
Let me explain in steps,
1) first drag the finger on touchpad, camera also starts rotating. that is fine
2) now stop dragging the finger and the camera is still rotating. even we don't release finger, camera rotates.
I think, the issues with below code block of VirtualTouchpad.cs script
Code:
/// <summary>
/// Callback when a pointer has dragged the button.
/// </summary>
/// <param name="data">The pointer data.</param>
public void OnDrag(PointerEventData data)
{
if (RectTransformUtility.RectangleContainsScreenPoint(m_RectTransform, data.position, null)) {
var canvasScale = m_CanvasScalarTransform == null ? Vector3.one : m_CanvasScalarTransform.localScale;
m_DeltaPosition.x += data.delta.x / canvasScale.x;
m_DeltaPosition.y += data.delta.y / canvasScale.y;
}
}