+1 vote

This is my code.
func _input(event): var Event = make_input_local(event) if Event == InputEventScreenTouch or Event: if Event.pressed: print("BLA BLA BLA")

I make a simple mobile game before. But now i can't solve this.
Never prints the words.

Can you help me?

in Engine by (106 points)

1 Answer

+1 vote

This is not how you process inputs. Use is for testing event type. For a touch (not a release), you want the event and pressed to be true. Example:

func _input(event):
    if event is InputEventScreenTouch and event.pressed:
        print("Screen was pressed")

I recommend you read this:

by (20,315 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.