diff --git a/Audio/pickup.wav b/Audio/pickup.wav index 88175de..2d3f957 100644 Binary files a/Audio/pickup.wav and b/Audio/pickup.wav differ diff --git a/Player.tscn b/Player.tscn index 44f980a..643cfba 100644 --- a/Player.tscn +++ b/Player.tscn @@ -1,7 +1,8 @@ -[gd_scene load_steps=5 format=3 uid="uid://4o2ljtcup5bo"] +[gd_scene load_steps=6 format=3 uid="uid://4o2ljtcup5bo"] [ext_resource type="Script" path="res://Scripts/Player.gd" id="1_jx17t"] [ext_resource type="AudioStream" uid="uid://bdv56js62pg7u" path="res://Audio/flashlight-click.wav" id="2_osxy2"] +[ext_resource type="AudioStream" uid="uid://cyx2nwgc7djsw" path="res://Audio/pickup.wav" id="3_7vucp"] [sub_resource type="CapsuleMesh" id="CapsuleMesh_x6nb0"] radius = 0.05 @@ -48,3 +49,6 @@ current = true [node name="CollisionShape3D" type="CollisionShape3D" parent="."] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.801599, 0) shape = SubResource("SphereShape3D_2j6of") + +[node name="Pickup" type="AudioStreamPlayer" parent="."] +stream = ExtResource("3_7vucp") diff --git a/Scripts/Player.gd b/Scripts/Player.gd index 18eead0..52cc1fd 100644 --- a/Scripts/Player.gd +++ b/Scripts/Player.gd @@ -56,6 +56,7 @@ func _on_flash_light_input_event(_camera, event, _position, _normal, _shape_idx) if event is InputEventMouseButton and event.is_action_pressed("interact"): $Pivot/Camera/FlashLight.visible = true has_flashlight = true + $Pickup.playing = true $".."/Gui.message("You can toggle the flashlight with right-mouse", "Flashlight") if flashlight: flashlight.visible = false diff --git a/Scripts/ladekast.gd b/Scripts/ladekast.gd index 86a5303..e49478b 100644 --- a/Scripts/ladekast.gd +++ b/Scripts/ladekast.gd @@ -19,3 +19,4 @@ func _on_sleutel_input_event(_camera, event, _position, _normal, _shape_idx): if event is InputEventMouseButton and event.is_action_pressed("interact"): $Kast/Drawer/Sleutel.visible = false get_node("../Player").has_key = true + get_node("../Player/Pickup").playing = true