0 votes

Hello,

I have a simple project in which I have a Area2d which is dropping from the top of my screen to the bottom (resolution = 1080x1920 in portrait) with the following code:

extends Area2D

var speed = 800

func _physics_process(delta):
    position.y += speed*delta
    if position.y > 1920:
        queue_free()

When the game is running on my desktop the movement is quite smooth, but when I export it to an android apk the movement is much less smooth.

I believe it is because my game is running at around 35 fps on my phone. If I force the fps on my computer to be 30 fps I am able to reproduce this issue.

I can also get rid of it if I set a lower speed for the object.

My question is, how to smooth the movement of fast objects on a android that runs at 30 fps ?

Thanks for your help.

Godot version 3.3.2
in Engine by (33 points)

1 Answer

0 votes

This is probably a result of the visuals being tied to the physics steps.

With fast movements and/or slow devices the rendering becomes visibly jerky as the visual frames do not interpolate (smooth) the steps out. This is a known limitation of the engine and is planned to be fixed in the future (4.0).

In the meantime there is an addon that exists specifically to solve this issue. You might be interested in trying it out: https://github.com/lawnjelly/smoothing-addon

Here is a video of what the addon does:
https://youtu.be/lWhHBAcH4sM?t=34

by (992 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.