Virtual Touchpad isn't working correctly

bluebird

Member
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

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;
            }
        }
 
If you update to the latest version there is now a property that allows you to specify if the touchpad requires an active drag. When you enable this the camera will stop rotating when you stop dragging your finger.
 
Hi Justin,

Thanks for the response.

Can I directly update asset from asset-store window and import the files?
Shall it override the existing files with out problem/errors?

Can you direct me, how do I update the project when you release update of UCC?

Thanks
 
Take a look at the release notes for the version that you are upgrading to - if it doesn't say that you need to first delete a folder then you can directly import on top.
 
Hi,

I finally upgraded UCC to version 2.1.2

And I fixed the problem of camera rotate with property 'Require Active Drag'

I made a build on Android with following parameters of UnityInput.cs

Look Vector Mode: Smoothed
Look Sensitivity: X = 50, y = 50
Smooth Look Steps: 1
Smooth Look Weight: 1
Look Acceleration Threshold: 1

Active Drag Damping: 1 (For touchpad)

I didn't feel controls is very good yet. It has good sensitivity(50) but experience is not as I expected.

There is swaying effect when I rotate camera every time. Even after drag ends, camera rotates lately. (similarly weapon sway effect)
I want to remove this effect or may be decrease the swaying. Let me know how can I do it.

Thanks
 
It sounds like you are wanting more control over mobile controls so I recommend an asset dedicated to that such as Control Freak or Easy Touch which are both integrated with the controller. This will give you more control over mobile input.
 
by the way, can we disable this sway(Even after drag ends, camera rotates lately) after I release the finger?
I'm ok with other controls.
 
Top