I want an action to be executed when a sprite is clicked (with touch). I have tried to solve this with the following post (https://godotengine.org/qa/3825/check-if-sprite-self-is-clicked) but unfortunately it does not work as expected... It does not react to anything anymore. With my previous code I was able to capture at least a touch input on the whole screen.
Here is my code where the touch input on the hole screen works and how I built the scene.
pass # Replace with function body.
func _input(event: InputEvent) -> void:
if event is InputEventScreenTouch and event.is_pressed():
Scene Build pictures: https://imgur.com/a/t6nB2vn
I want to instantiate the scene with the sprite into the main scene, where by pressing the sprite values should be changed.
Code of the main scene:
onready var touches_label : Label = $Container/VBoxContainer/Touches
var click_count := 0.0
func _ready() -> void:
func update_touches_label() -> void:
touches_label.text = str(click_count)