diff --git a/Assets/Levels/ApartmentNew.tscn b/Assets/Levels/ApartmentNew.tscn index 1b1e643..c5e9190 100644 --- a/Assets/Levels/ApartmentNew.tscn +++ b/Assets/Levels/ApartmentNew.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=3 uid="uid://bri7wyjwm34ja"] +[gd_scene load_steps=11 format=3 uid="uid://bri7wyjwm34ja"] [ext_resource type="PackedScene" uid="uid://b0jum86ejm134" path="res://Blender Files/Map_Pieces/ApartmentMap.blend" id="1_66kve"] [ext_resource type="PackedScene" uid="uid://cpwg1ula5qbrl" path="res://Assets/components/spawn_point.tscn" id="2_1wpo7"] @@ -8,6 +8,7 @@ [ext_resource type="PackedScene" uid="uid://bmys4dwvkv04a" path="res://Assets/Objects/Table.tscn" id="6_gd8ps"] [ext_resource type="PackedScene" uid="uid://tn77rr4ye5dv" path="res://Assets/Objects/vape.tscn" id="7_36js1"] [ext_resource type="PackedScene" uid="uid://cb4vbmqh76ksf" path="res://Blender Files/Objects/CeilingTiddy.blend" id="8_pky08"] +[ext_resource type="PackedScene" uid="uid://cvlwiscksxvr8" path="res://Assets/Objects/night_stand.tscn" id="9_rvpgu"] [sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_fbu3j"] data = PackedVector3Array(-1.0001, 0, 0.9998, 1, 0, -1, 1, 0, 0.9998, -1.0001, 0, 0.9998, -1.0001, 0, -1, 1, 0, -1, -1.0001, 0, 0.9998, -9.9198, 0, -1, -1.0001, 0, -1, -1.0001, 0, 0.9998, -9.9198, 0, 0.9998, -9.9198, 0, -1, -9.9198, 0, -1, -1.0001, 0, -11.585, -1.0001, 0, -1, -9.9198, 0, -1, -9.9198, 0, -11.585, -1.0001, 0, -11.585, -11.44, 0, -9.5852, -21.0853, 0, -11.585, -11.44, 0, -11.585, -11.44, 0, -9.5852, -21.0853, 0, -9.5852, -21.0853, 0, -11.585, -9.9198, 0, -9.5852, -11.44, 0, -11.585, -9.9198, 0, -11.585, -9.9198, 0, -9.5852, -11.44, 0, -9.5852, -11.44, 0, -11.585, -14.1889, 0, -1.464, -16.2628, 0, -4.5892, -14.1889, 0, -4.5892, -16.2628, 0, -4.5892, -14.1889, 0, 0.4066, -16.2628, 0, 0.4066, -14.1889, 0, -0.0977, -16.2628, 0, -4.5892, -14.1889, 0, -1.464, -16.2628, 0, -4.5892, -14.1889, 0, -0.0977, -14.1889, 0, 0.4066, -11.44, 0, -4.5892, -21.0853, 0, -9.5852, -11.44, 0, -9.5852, -21.0853, 0, -9.5852, -16.2628, 0, -4.5892, -21.0853, 0, -4.5892, -14.1889, 0, -4.5892, -21.0853, 0, -9.5852, -11.44, 0, -4.5892, -21.0853, 0, -9.5852, -14.1889, 0, -4.5892, -16.2628, 0, -4.5892, -16.2628, 0, 0.4066, -21.0853, 0, -4.5892, -16.2628, 0, -4.5892, -16.2628, 0, 0.4066, -21.0853, 0, 0.4066, -21.0853, 0, -4.5892, -11.44, 0, 0.4066, -14.0258, 0, -4.4202, -11.44, 0, -4.424, -14.0484, 0, -1.4563, -14.1889, 0, -0.0977, -14.1889, 0, -1.464, -11.44, 0, 0.4066, -14.0484, 0, -1.4563, -14.0258, 0, -4.4202, -14.0481, 0, -0.0919, -11.44, 0, 0.4066, -14.0396, 0, 0.4066, -14.0484, 0, -1.4563, -14.0481, 0, -0.0919, -14.1889, 0, -0.0977, -14.0484, 0, -1.4563, -11.44, 0, 0.4066, -14.0481, 0, -0.0919, -1.0001, 3.3694, 0.9998, 1, 3.3694, -1, -1.0001, 3.3694, -1, -1.0001, 3.3694, 0.9998, 1, 3.3694, 0.9998, 1, 3.3694, -1, -1.0001, 3.3694, 0.9998, -9.9198, 3.3694, -1, -9.9198, 3.3694, 0.9998, -1.0001, 3.3694, 0.9998, -1.0001, 3.3694, -1, -9.9198, 3.3694, -1, -9.9198, 3.3694, -1, -1.0001, 3.3694, -11.585, -9.9198, 3.3694, -11.585, -9.9198, 3.3694, -1, -1.0001, 3.3694, -1, -1.0001, 3.3694, -11.585, -11.44, 3.3694, -9.5852, -21.0853, 3.3694, -11.585, -21.0853, 3.3694, -9.5852, -11.44, 3.3694, -9.5852, -11.44, 3.3694, -11.585, -21.0853, 3.3694, -11.585, -9.9198, 3.3694, -9.5852, -11.44, 3.3694, -11.585, -11.44, 3.3694, -9.5852, -9.9198, 3.3694, -9.5852, -9.9198, 3.3694, -11.585, -11.44, 3.3694, -11.585, -14.1889, 3.3694, -4.5892, -16.2628, 3.3694, 0.4066, -14.1889, 3.3694, 0.4066, -14.1889, 3.3694, -4.5892, -16.2628, 3.3694, -4.5892, -16.2628, 3.3694, 0.4066, -21.0853, 3.3694, -9.5852, -11.44, 3.3694, -4.5892, -11.44, 3.3694, -9.5852, -21.0853, 3.3694, -9.5852, -14.1889, 3.3694, -4.5892, -11.44, 3.3694, -4.5892, -16.2628, 3.3694, -4.5892, -21.0853, 3.3694, -9.5852, -21.0853, 3.3694, -4.5892, -14.1889, 3.3694, -4.5892, -21.0853, 3.3694, -9.5852, -16.2628, 3.3694, -4.5892, -16.2628, 3.3694, -4.5892, -21.0853, 3.3694, 0.4066, -16.2628, 3.3694, 0.4066, -16.2628, 3.3694, -4.5892, -21.0853, 3.3694, -4.5892, -21.0853, 3.3694, 0.4066, -14.0437, 3.3694, 0.4066, -11.44, 3.3694, -4.4017, -14.0353, 3.3694, -4.3729, -14.0437, 3.3694, 0.4066, -11.44, 3.3694, 0.4066, -11.44, 3.3694, -4.4017, -9.9198, 0, 0.9998, -9.9198, 0, -11.585, -9.9198, 0, -1, -9.9198, 0, 0.9998, -9.9198, 0, -9.5852, -9.9198, 0, -11.585, -9.9198, 3.3694, 0.9998, -9.9198, 3.3694, -11.585, -9.9198, 3.3694, -9.5852, -9.9198, 3.3694, 0.9998, -9.9198, 3.3694, -1, -9.9198, 3.3694, -11.585, -1.0001, 0, -1, -1.0001, 3.3694, -11.585, -1.0001, 3.3694, -1, -1.0001, 0, -1, -1.0001, 0, -11.585, -1.0001, 3.3694, -11.585, 1, 0, 0.9998, 1, 3.3694, -1, 1, 3.3694, 0.9998, 1, 0, 0.9998, 1, 0, -1, 1, 3.3694, -1, 1, 0, -1, -1.0001, 3.3694, -1, 1, 3.3694, -1, 1, 0, -1, -1.0001, 0, -1, -1.0001, 3.3694, -1, -21.0853, 0, 0.4066, -16.2628, 3.3694, 0.4066, -21.0853, 3.3694, 0.4066, -21.0853, 0, 0.4066, -16.2628, 0, 0.4066, -16.2628, 3.3694, 0.4066, -9.9198, 0, -9.5852, -9.9198, 3.3694, 0.9998, -9.9198, 3.3694, -9.5852, -9.9198, 0, -9.5852, -9.9198, 0, 0.9998, -9.9198, 3.3694, 0.9998, -21.0853, 0, -4.5892, -21.0853, 3.3694, 0.4066, -21.0853, 3.3694, -4.5892, -21.0853, 0, -4.5892, -21.0853, 0, 0.4066, -21.0853, 3.3694, 0.4066, -21.0853, 0, -11.585, -21.0853, 3.3694, -9.5852, -21.0853, 3.3694, -11.585, -21.0853, 0, -11.585, -21.0853, 0, -9.5852, -21.0853, 3.3694, -9.5852, -11.44, 0, -4.5892, -11.44, 3.3694, -9.5852, -11.44, 3.3694, -4.5892, -11.44, 0, -4.5892, -11.44, 0, -9.5852, -11.44, 3.3694, -9.5852, -11.44, 0, -11.585, -21.0853, 3.3694, -11.585, -11.44, 3.3694, -11.585, -11.44, 0, -11.585, -21.0853, 0, -11.585, -21.0853, 3.3694, -11.585, -9.9198, 0, 0.9998, -1.0001, 3.3694, 0.9998, -9.9198, 3.3694, 0.9998, -9.9198, 0, 0.9998, -1.0001, 0, 0.9998, -1.0001, 3.3694, 0.9998, -11.44, 0, -9.5852, -9.9198, 3.3694, -9.5852, -11.44, 3.3694, -9.5852, -11.44, 0, -9.5852, -9.9198, 0, -9.5852, -9.9198, 3.3694, -9.5852, -9.9198, 0, -11.585, -11.44, 3.3694, -11.585, -9.9198, 3.3694, -11.585, -9.9198, 0, -11.585, -11.44, 0, -11.585, -11.44, 3.3694, -11.585, -1.0001, 0, -11.585, -9.9198, 3.3694, -11.585, -1.0001, 3.3694, -11.585, -1.0001, 0, -11.585, -9.9198, 0, -11.585, -9.9198, 3.3694, -11.585, -1.0001, 0, 0.9998, 1, 3.3694, 0.9998, -1.0001, 3.3694, 0.9998, -1.0001, 0, 0.9998, 1, 0, 0.9998, 1, 3.3694, 0.9998, -11.44, 0, -4.424, -11.44, 3.3694, 0.4066, -11.44, 0, 0.4066, -11.44, 3.3694, 0.4066, -11.44, 0, -4.4484, -11.44, 3.3694, -4.4017, -11.44, 3.3694, 0.4066, -11.44, 0, -4.424, -11.44, 0, -4.4484, -21.0853, 0, -9.5852, -21.0853, 3.3694, -4.5892, -21.0853, 3.3694, -9.5852, -21.0853, 0, -9.5852, -21.0853, 0, -4.5892, -21.0853, 3.3694, -4.5892, -16.2628, 0, 0.4066, -14.1889, 3.3694, 0.4066, -16.2628, 3.3694, 0.4066, -16.2628, 0, 0.4066, -14.1889, 0, 0.4066, -14.1889, 3.3694, 0.4066, -11.44, 0, -4.424, -11.44, 3.3694, -4.4017, -11.44, 0, -4.4484, -11.44, 3.3694, -4.4017, -14.0258, 0, -4.4202, -14.0353, 3.3694, -4.3729, -11.44, 0, -4.424, -14.0258, 0, -4.4202, -11.44, 3.3694, -4.4017, -14.1889, 2.1884, -0.0846, -14.0481, 0, -0.0919, -14.0481, 2.1591, -0.0919, -14.1889, 2.1884, -0.0846, -14.1889, 0, -0.0977, -14.0481, 0, -0.0919, -11.44, 3.3694, -4.5892, -14.1889, 0, -4.5892, -11.44, 0, -4.5892, -11.44, 3.3694, -4.5892, -14.1889, 3.3694, -4.5892, -14.1889, 0, -4.5892, -14.1889, 3.3694, -4.5892, -14.1889, 0, -1.464, -14.1889, 0, -4.5892, -14.1889, 3.3694, -4.5892, -14.1889, 2.1902, -1.4755, -14.1889, 0, -1.464, -14.1889, 0, -0.0977, -14.1889, 3.3694, 0.4066, -14.1889, 0, 0.4066, -14.1889, 3.3694, -4.5892, -14.1889, 2.1884, -0.0846, -14.1889, 2.1902, -1.4755, -14.1889, 2.1884, -0.0846, -14.1889, 3.3694, 0.4066, -14.1889, 0, -0.0977, -14.1889, 3.3694, 0.4066, -14.1889, 2.1884, -0.0846, -14.1889, 3.3694, -4.5892, -14.1889, 2.1884, -0.0846, -14.0484, 2.1591, -1.4563, -14.1889, 2.1902, -1.4755, -14.1889, 2.1884, -0.0846, -14.0481, 2.1591, -0.0919, -14.0484, 2.1591, -1.4563, -14.1889, 2.1902, -1.4755, -14.0484, 0, -1.4563, -14.1889, 0, -1.464, -14.1889, 2.1902, -1.4755, -14.0484, 2.1591, -1.4563, -14.0484, 0, -1.4563, -14.0396, 0, 0.4066, -11.44, 3.3694, 0.4066, -14.0437, 3.3694, 0.4066, -14.0396, 0, 0.4066, -11.44, 0, 0.4066, -11.44, 3.3694, 0.4066, -14.0484, 2.1591, -1.4563, -14.0437, 3.3694, 0.4066, -14.0353, 3.3694, -4.3729, -14.0484, 2.1591, -1.4563, -14.0481, 2.1591, -0.0919, -14.0437, 3.3694, 0.4066, -14.0437, 3.3694, 0.4066, -14.0481, 0, -0.0919, -14.0396, 0, 0.4066, -14.0437, 3.3694, 0.4066, -14.0481, 2.1591, -0.0919, -14.0481, 0, -0.0919, -14.0258, 0, -4.4202, -14.0484, 2.1591, -1.4563, -14.0353, 3.3694, -4.3729, -14.0258, 0, -4.4202, -14.0484, 0, -1.4563, -14.0484, 2.1591, -1.4563) @@ -48,4 +49,7 @@ collision_layer = 4 [node name="CeilingTiddy" parent="." instance=ExtResource("8_pky08")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.22615, 3.3694, -3.67555) +[node name="Night Stand" parent="." instance=ExtResource("9_rvpgu")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.50913, -2.38419e-07, -1.53862) + [editable path="ApartmentMap"] diff --git a/Assets/Objects/night_stand.tscn b/Assets/Objects/night_stand.tscn new file mode 100644 index 0000000..61830e0 --- /dev/null +++ b/Assets/Objects/night_stand.tscn @@ -0,0 +1,76 @@ +[gd_scene load_steps=8 format=3 uid="uid://cvlwiscksxvr8"] + +[ext_resource type="Script" path="res://Assets/scripts/night_stand.gd" id="1_5m56a"] +[ext_resource type="PackedScene" uid="uid://r7id1vke7msb" path="res://Blender Files/Objects/NightStand.blend" id="1_50kbp"] + +[sub_resource type="BoxShape3D" id="BoxShape3D_k5x08"] +size = Vector3(0.799194, 0.494141, 0.799316) + +[sub_resource type="Animation" id="Animation_wocdj"] +resource_name = "Open" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("NightStand/Drawer:blend_shapes/Drawer") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [0.0, 1.0] +} + +[sub_resource type="Animation" id="Animation_4ron5"] +resource_name = "Close" +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("NightStand/Drawer:blend_shapes/Drawer") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0, 1), +"transitions": PackedFloat32Array(1, 1), +"update": 0, +"values": [1.0, 0.0] +} + +[sub_resource type="Animation" id="Animation_yurxo"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("NightStand/Drawer:blend_shapes/Drawer") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [0.0] +} + +[sub_resource type="AnimationLibrary" id="AnimationLibrary_q4jho"] +_data = { +"Close": SubResource("Animation_4ron5"), +"Open": SubResource("Animation_wocdj"), +"RESET": SubResource("Animation_yurxo") +} + +[node name="Night Stand" type="StaticBody3D"] +collision_layer = 4 +script = ExtResource("1_5m56a") + +[node name="CollisionShape" type="CollisionShape3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.000183105, 0.24707, -0.000244141) +shape = SubResource("BoxShape3D_k5x08") + +[node name="NightStand" parent="." instance=ExtResource("1_50kbp")] + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +"": SubResource("AnimationLibrary_q4jho") +} + +[editable path="NightStand"] diff --git a/Assets/scripts/InteractRay.gd b/Assets/scripts/InteractRay.gd index b8e8681..59972c2 100644 --- a/Assets/scripts/InteractRay.gd +++ b/Assets/scripts/InteractRay.gd @@ -10,7 +10,7 @@ func _physics_process(delta): prompt.text = "" if is_colliding(): var collider = get_collider() - if collider is Interactable: + if collider: prompt.text = collider.promt_message if Input.is_action_just_pressed("interact"): collider.interact(owner) diff --git a/Assets/scripts/night_stand.gd b/Assets/scripts/night_stand.gd new file mode 100644 index 0000000..0e7d033 --- /dev/null +++ b/Assets/scripts/night_stand.gd @@ -0,0 +1,13 @@ +extends StaticBody3D + +@export var promt_message:String = "press e" +@export var promt_key:String +var is_open = false + +func interact(player): + if not is_open: + $AnimationPlayer.play("Open") + is_open = true + else: + $AnimationPlayer.play("Close") + is_open = false \ No newline at end of file diff --git a/Blender Files/Objects/NightStand.blend.import b/Blender Files/Objects/NightStand.blend.import new file mode 100644 index 0000000..06687f1 --- /dev/null +++ b/Blender Files/Objects/NightStand.blend.import @@ -0,0 +1,50 @@ +[remap] + +importer="scene" +importer_version=1 +type="PackedScene" +uid="uid://r7id1vke7msb" +path="res://.godot/imported/NightStand.blend-5dd61a5157f8ca599f80aa146919ff24.scn" + +[deps] + +source_file="res://Blender Files/Objects/NightStand.blend" +dest_files=["res://.godot/imported/NightStand.blend-5dd61a5157f8ca599f80aa146919ff24.scn"] + +[params] + +nodes/root_type="" +nodes/root_name="" +nodes/apply_root_scale=true +nodes/root_scale=1.0 +meshes/ensure_tangents=true +meshes/generate_lods=true +meshes/create_shadow_meshes=true +meshes/light_baking=1 +meshes/lightmap_texel_size=0.2 +meshes/force_disable_compression=false +skins/use_named_skins=true +animation/import=true +animation/fps=30 +animation/trimming=false +animation/remove_immutable_tracks=true +import_script/path="" +_subresources={} +gltf/naming_version=1 +gltf/embedded_image_handling=1 +blender/nodes/visible=0 +blender/nodes/punctual_lights=true +blender/nodes/cameras=true +blender/nodes/custom_properties=true +blender/nodes/modifiers=1 +blender/meshes/colors=false +blender/meshes/uvs=true +blender/meshes/normals=true +blender/meshes/tangents=true +blender/meshes/skins=2 +blender/meshes/export_bones_deforming_mesh_only=false +blender/materials/unpack_enabled=true +blender/materials/export_materials=1 +blender/animation/limit_playback=true +blender/animation/always_sample=true +blender/animation/group_tracks=true