0 votes

i have a game and in the game there is a button that is supposed to move the player.
it is a touchscreen button but i cannot figure out how to detect when the player has touched it. i am a beginner with godot.

my code:
extends TouchScreenButton

var motion = Vector2()
func _physics_process(_delta):
    if (is_pressed()):
        print("p")

pass

i cant seem to press it when i run. this is an android game. it is set to print right now as a test but its not printing

Godot version 3.3
in Engine by (37 points)

Nevermind, i figured out that in the action property of touchscreenbutton, i can set an input to trigger, and from a script i can check if the input has been triggered and do something

Please log in or register to answer this question.

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 [email protected] with your username.