pickup geluidje voor flashlight en sleutel

This commit is contained in:
2023-02-08 21:27:02 +01:00
parent 83aaf9ca4e
commit 1673d8e210
4 changed files with 7 additions and 1 deletions
BIN
View File
Binary file not shown.
+5 -1
View File
@@ -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")
+1
View File
@@ -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
+1
View File
@@ -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