Forum rules - please read before posting.

Draggables slow on iOS

Hello!

I'm having a bit of an issue with draggables. You can see the issue on this unlisted YouTube video here:

There you can see that draggables move super slowly on iOS, but they are quite responsive and nimble on desktop and in the editor.

The iOS build in the video has the exact settings as in the Unity Editor. Here are some specs:

AC Version: 1.79.3
Unity Version: 2021.3.5f1

DragThreshold (AC Settings Manager): 0

Draggable Component Settings:

Max Speed: 100
Player Motion Reduction: 0
Player Motion Influence: 1
Invert Input: False
Off-Screen Release: Grab Point

Drag Mode: Rotate Only
Rotation Factor: 0.25
Allow Zooming: False
Damping Factor: 10
Interaction On Grab: None
Interaction On Release: None

Any help with this would be amazing. Thanks!

Comments

  • Could it be down to the difference in resolution?

    Try changing the Game window's resolution in the Editor - does that affect the drag speed?

  • Hey Chris, thanks for the response. That doesn't work. I set the screen resolution to exactly 2732x2048, which is the iPad Pro's resolution. I made sure that the Game window was that size on my monitor (meaning the scale was 1), and it's still very nimble and fast; actually it's exactly the same. I played around with different sizes and it remains the same.

    It's worth noting that it's the same when installed on an iPhone as well.

    If you have any other ideas that would be great. Thanks again!

    • Jeremy
  • It may be that there are multiple factors at play, because on my end, the resolution does appear to affect the drag speed.

    It should be possible to eliminate that by opening up the HeldObjectData script, and inserting the following into line 105:

    if (ACScreen.wiidth > ACScreen.height) deltaInput *= 1920 / ACScreen.width;
    else deltaInput *= 1080 / ACScreen.height;
    

    If the issue remains, try also replacing line 122:

    dragForce /= Time.fixedDeltaTime * 50f;
    

    with:

    dragForce *= Time.deltaTime / 50f;
    

    What is the result then?

  • Hey Chris, sorry about the delay. I wasn't able to try for two days, and now I'm running into an issue with XCode, since implementing In App Purchases (you know, like "Buy Full Game", that kind of IAP). Once I get that sorted, I'll come right back to trying out a build on an iOS device.

    I did implement your second suggestion:

    dragForce *= Time.deltaTime / 50f;

    I had to set the Max Speed to 1000 and the Rotation Factor to 0.0001, but it's working great in the editor. I'll have to see if it works on an actual iOS device once I get this error sorted out. I'll let you know ASAP.

  • edited May 17

    Hey Chris!

    I'm back to this. Sorry about the long wait. I was going back and forth with code level support from Apple about an issue I was having with provisioning profiles. Blah blah blah. I got that working and was finally able to test on an iOS device this solution.

    The bad news is that this produces the exact same result. No difference. Very strange.

    To reiterate, I implemented your second suggestion:

    dragForce *= Time.deltaTime / 50f;

    I had to set the Max Speed to 1000 and the Rotation Factor to 0.0001. While the draggable is nimble and works great in the editor, it's still just as slow on a mobile device. I even created a second build with the Max Speed cranked up to 3000 and it's still as slow as ever.

    BTW, I also implemented the following code on line 105 of the HeldObjectData script:

    if (ACScreen.width > ACScreen.height) { deltaInput *= 1920f / ACScreen.width; } else { deltaInput *= 1080f / ACScreen.height; }

    Do you have any other ideas? Anything else that you think could cause it to be slow on mobile screens?

    • Jeremy
  • Thanks for the feedback. I will continue to think on it.

    Are you using Simulator? If so, is there any change with different devices?

  • One other point: I notice the 3D draggable has a pixellated look, despite the high resolution of the device. Is this a post-process / RenderTexture effect, or is the screen size being manually adjusted?

  • Thanks for getting back with me, Chris. No, this isn't a simulator. This in on device. It's the same on my iPhone 11 and my iPad pro. Same speed on both devices.

    As for the pixelated effect, this is just smoke and mirrors, so to speak, and doesn't have anything to do with the size of colliders or objects. You can watch this quick video to see how I've set it up:

    https://www.loom.com/share/ce0adc74c35f4c52891f1ff6fa03c52a?sid=ae595da3-9d60-47ee-9e65-6ccc8207cfc7

    I appreciate you thinking on it. Much appreciated!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.