+1 vote

Hi!!!
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?

asked May 9 in Engine by Nitsuga (33 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:
https://docs.godotengine.org/en/3.2/tutorials/inputs/input_examples.html

answered May 9 by kidscancode (17,762 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.