Touch control for mobile very sluggish

Hi. So I am making a mobile game with UCC using 3rd person Adventure view. I use touch control for camera rotation. When testing via Unity editor, it works fine. The camera will move with the mouse at the same speed I drag my mouse. When I put it on mobile device, the touch control is extremely sluggish and hardly playable.

I tried replacing the control with InControl integration as well, where the touch control will control the "Controller X" and "Controller Y". Again on the editor, the camera moves perfectly in sync with my mouse drag. But mobile, there is a severe lag, where After I drag, the camera will follow sluggishly.

You might think it is the Camera Controller smoothing, but I have disabled all that so that the dragging should be consistent with camera rotation speed and no fancy smoothing and delays.
1668994099266.png


For your reference here are some settings incase you need them:
1668994128533.png
 
For touch controls you shouldn't be using the Controller X or Controller Y input mappings. You should instead just use the Mouse X and Y input mapping. Also, have you tried profiling to ensure you aren't getting any framerate drop?
 
Hi I tried mapping to mouse XY as well it's the same behavior. It is not performance issue from profile results. I also tried rewired. Here is the interesting part. Tested on same mobile device, if I use the mouse input which anywhere I drag on the screen it works fine like in the editor, but unfortunately I cannot specify the touch area so it means even when I use the joystick to walk I will be rotating the camera. If I use touchpad control mapped to mouse XY, it is sluggish just like InControl and opsives touch control.
 
On the PlayerInput component you should disable Mouse Controller Update but I doubt that's the cause.

Last week with the input changes I tested an Android build and didn't notice these issues so that makes it tough. If you output the input values sent to the Camera Controller Handler can you notice any difference when on your device?
 
On the PlayerInput component you should disable Mouse Controller Update but I doubt that's the cause.

Last week with the input changes I tested an Android build and didn't notice these issues so that makes it tough. If you output the input values sent to the Camera Controller Handler can you notice any difference when on your device?
You mean to put some logs here? The breakpoint never gets hit whatever action I take: CameraControllerHandle.cs
1669030029839.png
 
EDIT: After posting this I realized that the below test cases work in Editor as well. It's just more obvious on mobile device. If you drag the mouse to pan the camera via a touch controller, it will not follow the mouse speed. The camera moves faster if you drag the mouse slowly, but cannot keep up to faster dragging. But when not using touch controller, the camera pans as expected no matter what speed you move the mouse/finger.

Just to make it clear. Using the same Android device here are 2 scenarios:

Scenario #1: a.k.a. Touch Controller Version
Check ON the "Disable the mouse input when the touch controller is enabled" box, meaning I'm using the touch controller to pan the camera. This is via Rewired, but it's the exact same behavior with any other integration, Incontrol, or the one that comes with UCC. See video below.
1669030621300.png

Here is the results. Camera does not pan when fingers move fast.


Scenario #2: a.k.a. "Mouse" Version (Even tho it's really still touch control under the hood)
Uncheck "Disable the mouse input when the touch controller is enabled", meaning Now I'm no longer using the touch controller integration to pan the camera.

Here is the results. Camera pans properly even if I move finger fast.


So something is wrong with touch control integrating with UCC, not really a performance thing since it works fine on the "mouse" version.

If this can be fixed, that's great, if not, then is there a way to make it so the "mouse" version can work nice by not being activated when I touch the touch joystick and the touch buttons? Because this "Mouse" version works the perfectly the way a touch control should work. But the problem is it detects any part of the screen and pans the camera even if other UI is in front.
 
Last edited:
You mean to put some logs here? The breakpoint never gets hit whatever action I take: CameraControllerHandle.cs
No, I mean at this location within GetMoveInput:

Code:
            horizontalMovement = lookVector.x;
            forwardMovement = lookVector.y;

It looks like the mouse setting is something within Rewired? I'm not familiar with that - when I tested I was using the built-in touch controls. I didn't specifically move my finger that fast when testing so I'll give it a try and let you know (and send you the build).
 
I just built an apk for you to test against. In this I am using the included virtual controls. I didn't like how the touchpad would stop when I stopped moving my finger so the only difference between this build and the one on the Asset Store is that the touchpad can now use the absolute position. I
 
I just built an apk for you to test against. In this I am using the included virtual controls. I didn't like how the touchpad would stop when I stopped moving my finger so the only difference between this build and the one on the Asset Store is that the touchpad can now use the absolute position. I
Thanks for this. This is exactly the same problem. A player on mobile playing an FPS for example would not be able to aim at someone 90 degrees to the left or right with this slowness. The player should be able to drag the finger and the camera would move at the same consistent speed as the finger like in this video when using touch control

Is there a way the touch pad can track the same speed as the finger, like a mouse? The APK you provided acts more like a joystick than a track pad.
 
Last edited:
You can adjust the speed using the smoothing property of the player input component. This will speed up or slow down the camera rotation. There is also a multiplier you can apply to the smoothing.
 
Yes I can change the the sensitivity, but it still does not work like a touch pad, more like a very sensitive joystick that follows the finger with a delay. Also when you run it on a fast device it will follow faster, and when you run it on a slower device it takes longer. If you can kindly make the track pad large enough and then run it on an actual android device and try to pretend it's an FPS shooter, you will see that it's not going to be very easy to aim. Again, it is just acting like a joystick, not a track pad, e.g. trackpad on a laptop, when you move a mouse cursor, the cursor moves with the finger, not like the joystick.
 
By default the touch pad uses the delta position to move. This by design is similar to a trackpad on a laptop. What could be giving the slow movement is the screen dpi. I will add an option to the built in touch pad that allows you to multiply the delta position by a value. This will then allow you to increase or decrease the speed based on the dpi.

Note that this will only be for the built in touch pad. If you are using an integration then it's up to the value returned by that integration.
 
Last edited:
I have tried InControl, Rewired, and they are both very bad on an actual device(perfectly fine on Editor).
That would be great, would you mind giving me the code that I should change so I can modify it myself to test real quickly?
 
Here is something interesting. When I turn on this box below, then I am able to get the proper behavior, but not by using the touch control touchpad, but just dragging anywhere on the screen that is NOT the touchpad, it works the way it should work. So if you can make the touch pad work like the axis control, then that would be perfect. I would just use the axis control, but the problem is it captures the whole screen, even when I press buttons and joysticks, so otherwise it would be perfect.
1669285513054.png
 
Allow axis input uses the standard Input Manager API to get the Mouse X value:


I guess that is somehow mapped to the touch position? In the latest update I included a new touchpad that allows you to use GetAxis instead of the touch delta position. This also allows you to add a multiplier.
 
Top