Добавить
Уведомления

How to detect a click on a Sprite in Godot (EASY)

CODE: func _input(event): if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: if get_rect().has_point(to_local(event.position)): print("You clicked on Sprite!")

Иконка канала JavaScript Боты
15 подписчиков
12+
107 просмотров
2 года назад
12+
107 просмотров
2 года назад

CODE: func _input(event): if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: if get_rect().has_point(to_local(event.position)): print("You clicked on Sprite!")

, чтобы оставлять комментарии