0 votes

Hey everyone!

Im using SCREEN_DRAG to move my player over the screen.
The problem is, that when i hold my finger on a constant postion on the screen the SCREEN_DRAG stops triggering. resulting in stuttering/stopping moving of my character.

Any help?

in Engine by (25 points)
edited by

1 Answer

+1 vote

The SCREENDRAG is only when you have moved your finger, you can use SCREENTOUCH to find a single touch on a single point.
but be ware that once you moved your finger a little bit it would count as a SCREEN_DRAG.

the touch support right now is kinda sh*t so try avoiding the use of _input() and try using more screen buttons(or whatever its called) and some custom masks to set the game if you can

by (1,181 points)

so basicly there is no way for godot to realize a constant fingertouch? is there any workaround?

you can use:

if event.type == InputEvent.SCREEN_TOUCH or event.type == InputEvent.SREEN_DRAG

that way he will read both for the same block of code.

But as far as i understood, SCREEN_TOUCH only triggers on press & release, not on constant touch. And Drag only on moving a finger on the screen. Or did i unsterstand something worng?

By what i have understood from playing with it on my phone if you want to have a constant touch at the same location you can use:

if event.type == InputEvent.SCREEN_TOUCH and event.pressed:
     some code here
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.