0 votes

I haven't done any android testing, so I don't know if the answer of my question is in the device interaction or not but...

I've noticed that InputEventScreenTouch doesn't echo. InputEventScreenDrag only echo's while the mouse is moving. I don't know how I would register someone holding their finger down on the screen (while not moving it) without having Godot use the emulate_mouse_from_touch in the project settings, and then using InputEventMouse

What's the proper way this (ScreenTouch echo) is achieved?

Godot version 3.3
in Engine by (359 points)

1 Answer

0 votes

Hello,
This is what I've used:

func _input(event):
if event is InputEventMouseButton:
    if event.button_index == BUTTON_LEFT and not event.pressed:
        _mousedown = false
    else:
        if _mousedown == false:
            _last_position = get_global_mouse_position()
        _mousedown = true

This lets me move a spaceship

by (1,967 points)

Does this mean you're using emulate_touch_from_mouse? (In the Godot project settings.)

I do.
Both emulate_touch_from_mouse & emulate_mouse_from_touch are set to on. I don't know if they are both required, but it works with those settings for me.

The video was recorded on an Android phone. I've not tested it on an iPhone.

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 Frequently asked questions and 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.