This repository has been archived on 2025-09-12. You can view files and clone it, but cannot push or open issues or pull requests.
ld50/scene/PhysicalButton.gd
2022-04-05 02:48:20 +02:00

11 lines
321 B
GDScript

extends Area
signal pressed()
func _input_event(camera: Object, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) -> void:
if (event is InputEventMouseButton
&& event.button_index == 1
&& event.is_pressed()
):
emit_signal("pressed")
Sound.instance("GUI GreenButton").attach(self).start()