Compare commits

...
Author SHA1 Message Date
Vojta f0b8c0fd48 Aesthetic improvements that won't be seen 2025-06-19 14:19:10 +02:00
Vojta 700fed5a87 Just record me going through the house 2025-06-19 00:10:14 +02:00
Vojta 2de2b7f5ee Go back to player-gameplay? 2025-06-18 23:26:17 +02:00
Vojta 505904e595 Better path 2025-06-18 23:18:25 +02:00
Vojta 205551af5a B fly in - draft 2025-06-18 23:12:28 +02:00
Vojta fad7a60c5e Sequence A 2025-06-18 22:42:49 +02:00
Vojta c793535235 Fly around 2025-06-18 22:37:47 +02:00
Vojta 84f8cf5d76 Cinematic camera 2025-06-18 21:27:27 +02:00
Vojta 89210f59ea Adjust meadow vegetation 2025-06-18 21:27:23 +02:00
17 changed files with 282 additions and 95 deletions

No files matched your search

+2
View File
@@ -2,3 +2,5 @@
.godot/ .godot/
/android/ /android/
.DS_Store .DS_Store
captures/*
!captures/.gdignore
Binary file not shown.
Binary file not shown.
View File
Whitespace-only changes.
+7 -1
View File
@@ -32,6 +32,12 @@ animation/trimming=false
animation/remove_immutable_tracks=true animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false animation/import_rest_as_RESET=false
import_script/path="" import_script/path=""
_subresources={} _subresources={
"nodes": {
"PATH:Chandelier": {
"mesh_instance/cast_shadow": 0
}
}
}
gltf/naming_version=1 gltf/naming_version=1
gltf/embedded_image_handling=1 gltf/embedded_image_handling=1
+4
View File
@@ -20,6 +20,10 @@ config/icon="res://icon.svg"
window/size/viewport_width=1920 window/size/viewport_width=1920
window/size/viewport_height=1080 window/size/viewport_height=1080
[editor]
movie_writer/mjpeg_quality=0.9
[editor_plugins] [editor_plugins]
enabled=PackedStringArray("res://addons/portals/plugin.cfg", "res://addons/proton_scatter/plugin.cfg") enabled=PackedStringArray("res://addons/portals/plugin.cfg", "res://addons/proton_scatter/plugin.cfg")
+141 -30
View File
@@ -1,10 +1,10 @@
[gd_scene load_steps=63 format=3 uid="uid://clxuoprslq8em"] [gd_scene load_steps=73 format=3 uid="uid://clxuoprslq8em"]
[ext_resource type="Script" uid="uid://4nvvgle511m4" path="res://scripts/house_big.gd" id="1_158ph"] [ext_resource type="Script" uid="uid://4nvvgle511m4" path="res://scripts/house_big.gd" id="1_158ph"]
[ext_resource type="PackedScene" uid="uid://wsu3b5udqtdu" path="res://meshes/village/Wall_UnevenBrick_Straight.gltf" id="1_p6qno"] [ext_resource type="PackedScene" uid="uid://wsu3b5udqtdu" path="res://meshes/village/Wall_UnevenBrick_Straight.gltf" id="1_p6qno"]
[ext_resource type="PackedScene" uid="uid://clysjxno24doq" path="res://meshes/village/Wall_UnevenBrick_Door_Round.gltf" id="2_158ph"] [ext_resource type="PackedScene" uid="uid://clysjxno24doq" path="res://meshes/village/Wall_UnevenBrick_Door_Round.gltf" id="2_158ph"]
[ext_resource type="PackedScene" uid="uid://cqm26jf01p8uv" path="res://scenes/portal_door.tscn" id="3_54eow"] [ext_resource type="PackedScene" uid="uid://cqm26jf01p8uv" path="res://scenes/portal_door.tscn" id="3_54eow"]
[ext_resource type="PackedScene" uid="uid://ewd06ff76y0i" path="res://scenes/meadow.tscn" id="4_8wplv"] [ext_resource type="Script" uid="uid://mlpya7qid02x" path="res://addons/proton_scatter/src/scatter.gd" id="4_u6m7x"]
[ext_resource type="Script" uid="uid://dr0q8wis1hmem" path="res://addons/proton_scatter/src/stack/modifier_stack.gd" id="5_3bxb3"] [ext_resource type="Script" uid="uid://dr0q8wis1hmem" path="res://addons/proton_scatter/src/stack/modifier_stack.gd" id="5_3bxb3"]
[ext_resource type="PackedScene" uid="uid://58nhhimrudas" path="res://meshes/village/Overhang_UnevenBrick_Corner_Front.gltf" id="5_k70vi"] [ext_resource type="PackedScene" uid="uid://58nhhimrudas" path="res://meshes/village/Overhang_UnevenBrick_Corner_Front.gltf" id="5_k70vi"]
[ext_resource type="Script" uid="uid://cnmsv3hyahjcc" path="res://addons/proton_scatter/src/modifiers/base_modifier.gd" id="6_53v87"] [ext_resource type="Script" uid="uid://cnmsv3hyahjcc" path="res://addons/proton_scatter/src/modifiers/base_modifier.gd" id="6_53v87"]
@@ -17,12 +17,15 @@
[ext_resource type="Script" uid="uid://quoo7t5rxnu3" path="res://addons/proton_scatter/src/modifiers/project_on_geometry.gd" id="10_1c0ay"] [ext_resource type="Script" uid="uid://quoo7t5rxnu3" path="res://addons/proton_scatter/src/modifiers/project_on_geometry.gd" id="10_1c0ay"]
[ext_resource type="PackedScene" uid="uid://c3fv7wek4rjjt" path="res://meshes/village/Floor_WoodLight.gltf" id="10_abcjp"] [ext_resource type="PackedScene" uid="uid://c3fv7wek4rjjt" path="res://meshes/village/Floor_WoodLight.gltf" id="10_abcjp"]
[ext_resource type="PackedScene" uid="uid://blaba7vpajd15" path="res://meshes/village/Stair_Interior_SolidExtended.gltf" id="11_3kjtd"] [ext_resource type="PackedScene" uid="uid://blaba7vpajd15" path="res://meshes/village/Stair_Interior_SolidExtended.gltf" id="11_3kjtd"]
[ext_resource type="Script" uid="uid://dqqal1jno4xml" path="res://addons/proton_scatter/src/scatter_item.gd" id="11_nrbqc"]
[ext_resource type="Script" uid="uid://bsl3en0gdt8ka" path="res://addons/proton_scatter/src/scatter_shape.gd" id="11_purgm"] [ext_resource type="Script" uid="uid://bsl3en0gdt8ka" path="res://addons/proton_scatter/src/scatter_shape.gd" id="11_purgm"]
[ext_resource type="Script" uid="uid://d011g8ga6gea7" path="res://addons/proton_scatter/src/shapes/box_shape.gd" id="12_615iq"] [ext_resource type="Script" uid="uid://d011g8ga6gea7" path="res://addons/proton_scatter/src/shapes/box_shape.gd" id="12_615iq"]
[ext_resource type="PackedScene" uid="uid://cehdhfocv3rxc" path="res://meshes/village/Balcony_Simple_Straight.gltf" id="12_ah86a"] [ext_resource type="PackedScene" uid="uid://cehdhfocv3rxc" path="res://meshes/village/Balcony_Simple_Straight.gltf" id="12_ah86a"]
[ext_resource type="Script" uid="uid://djsvn08xssx6k" path="res://addons/proton_scatter/src/shapes/sphere_shape.gd" id="13_1c0ay"]
[ext_resource type="PackedScene" uid="uid://di0splvet24bj" path="res://meshes/village/Corner_Interior_Small.gltf" id="13_fp7uc"] [ext_resource type="PackedScene" uid="uid://di0splvet24bj" path="res://meshes/village/Corner_Interior_Small.gltf" id="13_fp7uc"]
[ext_resource type="PackedScene" uid="uid://duvcn6t2vv8ld" path="res://meshes/interior/Bookcase_2.gltf" id="14_tp3c1"] [ext_resource type="PackedScene" uid="uid://duvcn6t2vv8ld" path="res://meshes/interior/Bookcase_2.gltf" id="14_tp3c1"]
[ext_resource type="PackedScene" uid="uid://e5chiaecfb3h" path="res://meshes/interior/BookGroup_Medium_1.gltf" id="15_abcjp"] [ext_resource type="PackedScene" uid="uid://e5chiaecfb3h" path="res://meshes/interior/BookGroup_Medium_1.gltf" id="15_abcjp"]
[ext_resource type="Script" uid="uid://bfr4urrxjg8sm" path="res://addons/proton_scatter/src/cache/scatter_cache.gd" id="15_u6m7x"]
[ext_resource type="PackedScene" uid="uid://c7oppbvnch75o" path="res://meshes/interior/BookGroup_Small_2.gltf" id="16_3kjtd"] [ext_resource type="PackedScene" uid="uid://c7oppbvnch75o" path="res://meshes/interior/BookGroup_Small_2.gltf" id="16_3kjtd"]
[ext_resource type="PackedScene" uid="uid://cw2nkxh0q1rd8" path="res://meshes/interior/Book_Stack_2.gltf" id="17_ah86a"] [ext_resource type="PackedScene" uid="uid://cw2nkxh0q1rd8" path="res://meshes/interior/Book_Stack_2.gltf" id="17_ah86a"]
[ext_resource type="PackedScene" uid="uid://b0pjo7hna5kdm" path="res://meshes/village/Roof_RoundTiles_8x8.gltf" id="18_k1p6y"] [ext_resource type="PackedScene" uid="uid://b0pjo7hna5kdm" path="res://meshes/village/Roof_RoundTiles_8x8.gltf" id="18_k1p6y"]
@@ -50,8 +53,15 @@
[ext_resource type="PackedScene" uid="uid://ghgretojabc1" path="res://meshes/interior/Vase_4.gltf" id="40_4hat2"] [ext_resource type="PackedScene" uid="uid://ghgretojabc1" path="res://meshes/interior/Vase_4.gltf" id="40_4hat2"]
[ext_resource type="PackedScene" uid="uid://co7ijbeyonv5" path="res://meshes/interior/Book_5.gltf" id="41_u6m7x"] [ext_resource type="PackedScene" uid="uid://co7ijbeyonv5" path="res://meshes/interior/Book_5.gltf" id="41_u6m7x"]
[ext_resource type="PackedScene" uid="uid://d1imd6qqtgy2e" path="res://meshes/village/Stair_Interior_Rails.gltf" id="42_isn6p"] [ext_resource type="PackedScene" uid="uid://d1imd6qqtgy2e" path="res://meshes/village/Stair_Interior_Rails.gltf" id="42_isn6p"]
[ext_resource type="PackedScene" uid="uid://c3myqiuhgghyo" path="res://meshes/interior/Lantern_Wall.gltf" id="54_nrbqc"]
[sub_resource type="Resource" id="Resource_3bxb3"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dss4m"]
albedo_color = Color(0.448364, 0.428649, 0.0977373, 1)
[sub_resource type="BoxMesh" id="BoxMesh_kpybi"]
size = Vector3(1000, 0.5, 1000)
[sub_resource type="Resource" id="Resource_nrbqc"]
script = ExtResource("7_4hat2") script = ExtResource("7_4hat2")
amount = 1500 amount = 1500
enabled = true enabled = true
@@ -60,7 +70,7 @@ custom_seed = 0
restrict_height = true restrict_height = true
reference_frame = 1 reference_frame = 1
[sub_resource type="Resource" id="Resource_53v87"] [sub_resource type="Resource" id="Resource_1c0ay"]
script = ExtResource("8_u6m7x") script = ExtResource("8_u6m7x")
position = Vector3(0.15, 0.15, 0.15) position = Vector3(0.15, 0.15, 0.15)
rotation = Vector3(20, 360, 20) rotation = Vector3(20, 360, 20)
@@ -71,7 +81,7 @@ custom_seed = 0
restrict_height = false restrict_height = false
reference_frame = 2 reference_frame = 2
[sub_resource type="Resource" id="Resource_4hat2"] [sub_resource type="Resource" id="Resource_purgm"]
script = ExtResource("9_nrbqc") script = ExtResource("9_nrbqc")
iterations = 3 iterations = 3
offset_step = 0.2 offset_step = 0.2
@@ -83,7 +93,7 @@ custom_seed = 0
restrict_height = true restrict_height = true
reference_frame = 0 reference_frame = 0
[sub_resource type="Resource" id="Resource_u6m7x"] [sub_resource type="Resource" id="Resource_615iq"]
script = ExtResource("10_1c0ay") script = ExtResource("10_1c0ay")
ray_direction = Vector3(0, -1, 0) ray_direction = Vector3(0, -1, 0)
ray_length = 5.0 ray_length = 5.0
@@ -99,16 +109,26 @@ custom_seed = 0
restrict_height = false restrict_height = false
reference_frame = 0 reference_frame = 0
[sub_resource type="Resource" id="Resource_nrbqc"] [sub_resource type="Resource" id="Resource_31h7w"]
script = ExtResource("5_3bxb3") script = ExtResource("5_3bxb3")
stack = Array[ExtResource("6_53v87")]([SubResource("Resource_3bxb3"), SubResource("Resource_53v87"), SubResource("Resource_4hat2"), SubResource("Resource_u6m7x")]) stack = Array[ExtResource("6_53v87")]([SubResource("Resource_nrbqc"), SubResource("Resource_1c0ay"), SubResource("Resource_purgm"), SubResource("Resource_615iq")])
[sub_resource type="Resource" id="Resource_37qwj"]
script = ExtResource("13_1c0ay")
radius = 18.0
metadata/_custom_type_script = "uid://djsvn08xssx6k"
[sub_resource type="Resource" id="Resource_navra"]
script = ExtResource("12_615iq")
size = Vector3(5.47877, 1, 7.53509)
metadata/_custom_type_script = "uid://d011g8ga6gea7"
[sub_resource type="Resource" id="Resource_u2sk2"] [sub_resource type="Resource" id="Resource_u2sk2"]
script = ExtResource("12_615iq") script = ExtResource("12_615iq")
size = Vector3(15.4096, 1, 9.6442) size = Vector3(15.4096, 1, 9.6442)
metadata/_custom_type_script = "uid://d011g8ga6gea7" metadata/_custom_type_script = "uid://d011g8ga6gea7"
[sub_resource type="Resource" id="Resource_1c0ay"] [sub_resource type="Resource" id="Resource_ob3ci"]
script = ExtResource("7_4hat2") script = ExtResource("7_4hat2")
amount = 1200 amount = 1200
enabled = true enabled = true
@@ -117,7 +137,7 @@ custom_seed = 0
restrict_height = true restrict_height = true
reference_frame = 1 reference_frame = 1
[sub_resource type="Resource" id="Resource_purgm"] [sub_resource type="Resource" id="Resource_61s38"]
script = ExtResource("8_u6m7x") script = ExtResource("8_u6m7x")
position = Vector3(0.1, 0.15, 0.1) position = Vector3(0.1, 0.15, 0.1)
rotation = Vector3(10, 360, 10) rotation = Vector3(10, 360, 10)
@@ -128,7 +148,7 @@ custom_seed = 0
restrict_height = false restrict_height = false
reference_frame = 2 reference_frame = 2
[sub_resource type="Resource" id="Resource_615iq"] [sub_resource type="Resource" id="Resource_p6hgd"]
script = ExtResource("9_nrbqc") script = ExtResource("9_nrbqc")
iterations = 3 iterations = 3
offset_step = 0.2 offset_step = 0.2
@@ -140,7 +160,7 @@ custom_seed = 0
restrict_height = true restrict_height = true
reference_frame = 0 reference_frame = 0
[sub_resource type="Resource" id="Resource_31h7w"] [sub_resource type="Resource" id="Resource_o0mww"]
script = ExtResource("10_1c0ay") script = ExtResource("10_1c0ay")
ray_direction = Vector3(0, -1, 0) ray_direction = Vector3(0, -1, 0)
ray_length = 5.0 ray_length = 5.0
@@ -156,9 +176,19 @@ custom_seed = 0
restrict_height = false restrict_height = false
reference_frame = 0 reference_frame = 0
[sub_resource type="Resource" id="Resource_ob3ci"] [sub_resource type="Resource" id="Resource_ckunl"]
script = ExtResource("5_3bxb3") script = ExtResource("5_3bxb3")
stack = Array[ExtResource("6_53v87")]([SubResource("Resource_1c0ay"), SubResource("Resource_purgm"), SubResource("Resource_615iq"), SubResource("Resource_31h7w")]) stack = Array[ExtResource("6_53v87")]([SubResource("Resource_ob3ci"), SubResource("Resource_61s38"), SubResource("Resource_p6hgd"), SubResource("Resource_o0mww")])
[sub_resource type="Resource" id="Resource_f17e3"]
script = ExtResource("12_615iq")
size = Vector3(70, 1, 70)
metadata/_custom_type_script = "uid://d011g8ga6gea7"
[sub_resource type="Resource" id="Resource_x2olw"]
script = ExtResource("13_1c0ay")
radius = 18.0
metadata/_custom_type_script = "uid://djsvn08xssx6k"
[sub_resource type="BoxShape3D" id="BoxShape3D_61s38"] [sub_resource type="BoxShape3D" id="BoxShape3D_61s38"]
size = Vector3(2.17578, 0.0646484, 7.88184) size = Vector3(2.17578, 0.0646484, 7.88184)
@@ -172,13 +202,47 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.2, 0
[node name="PortalDoor" parent="." instance=ExtResource("3_54eow")] [node name="PortalDoor" parent="." instance=ExtResource("3_54eow")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.1, 0, -3.2) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.1, 0, -3.2)
[node name="Meadow" parent="." instance=ExtResource("4_8wplv")] [node name="Meadow" type="MeshInstance3D" parent="."]
material_override = SubResource("StandardMaterial3D_dss4m")
mesh = SubResource("BoxMesh_kpybi")
metadata/_edit_lock_ = true metadata/_edit_lock_ = true
[node name="ScatterGrass" parent="Meadow" index="0"] [node name="ScatterGrass" type="Node3D" parent="Meadow"]
modifier_stack = SubResource("Resource_nrbqc") script = ExtResource("4_u6m7x")
force_rebuild_on_load = false
modifier_stack = SubResource("Resource_31h7w")
Performance/use_chunks = true
Performance/chunk_dimensions = Vector3(15, 15, 15)
metadata/_custom_type_script = "uid://mlpya7qid02x"
[node name="BigHouseNegative" type="Node3D" parent="Meadow/ScatterGrass" index="5"] [node name="ScatterItem" type="Node3D" parent="Meadow/ScatterGrass"]
script = ExtResource("11_nrbqc")
path = "uid://cia3jakp3wj1d"
[node name="ScatterItem2" type="Node3D" parent="Meadow/ScatterGrass"]
script = ExtResource("11_nrbqc")
path = "uid://c3c76je2y6vfj"
[node name="ScatterItem3" type="Node3D" parent="Meadow/ScatterGrass"]
script = ExtResource("11_nrbqc")
proportion = 25
path = "uid://bltmr2xgs8nq1"
[node name="ScatterShape" type="Node3D" parent="Meadow/ScatterGrass"]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 0, 0)
visible = false
script = ExtResource("11_purgm")
shape = SubResource("Resource_37qwj")
[node name="NegativeHouse" type="Node3D" parent="Meadow/ScatterGrass"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.2, 0, -2.4)
visible = false
script = ExtResource("11_purgm")
negative = true
shape = SubResource("Resource_navra")
metadata/_custom_type_script = "uid://bsl3en0gdt8ka"
[node name="BigHouseNegative" type="Node3D" parent="Meadow/ScatterGrass"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.12166, 0, -3.63027) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.12166, 0, -3.63027)
visible = false visible = false
script = ExtResource("11_purgm") script = ExtResource("11_purgm")
@@ -186,8 +250,40 @@ negative = true
shape = SubResource("Resource_u2sk2") shape = SubResource("Resource_u2sk2")
metadata/_custom_type_script = "uid://bsl3en0gdt8ka" metadata/_custom_type_script = "uid://bsl3en0gdt8ka"
[node name="ScatterTrees" parent="Meadow" index="1"] [node name="ScatterTrees" type="Node3D" parent="Meadow"]
modifier_stack = SubResource("Resource_ob3ci") script = ExtResource("4_u6m7x")
force_rebuild_on_load = false
modifier_stack = SubResource("Resource_ckunl")
Performance/use_chunks = true
Performance/chunk_dimensions = Vector3(15, 15, 15)
metadata/_custom_type_script = "uid://mlpya7qid02x"
[node name="PineTree" type="Node3D" parent="Meadow/ScatterTrees"]
script = ExtResource("11_nrbqc")
path = "uid://caqxfqurbp3ku"
[node name="Bush" type="Node3D" parent="Meadow/ScatterTrees"]
script = ExtResource("11_nrbqc")
proportion = 50
path = "uid://b8abs8me7ckgo"
[node name="ScatterShape" type="Node3D" parent="Meadow/ScatterTrees"]
transform = Transform3D(1, 0, -2.98023e-08, 0, 1, 0, 2.98023e-08, 0, 1, 0, 0, 0)
visible = false
script = ExtResource("11_purgm")
shape = SubResource("Resource_f17e3")
[node name="NegativeTrees" type="Node3D" parent="Meadow/ScatterTrees"]
visible = false
script = ExtResource("11_purgm")
negative = true
shape = SubResource("Resource_x2olw")
metadata/_custom_type_script = "uid://bsl3en0gdt8ka"
[node name="ScatterCache" type="Node3D" parent="Meadow"]
script = ExtResource("15_u6m7x")
cache_file = "res://addons/proton_scatter/cache/house_big_10774354_scatter_cache.res"
metadata/_custom_type_script = "uid://bfr4urrxjg8sm"
[node name="WallsAndShit" type="Node3D" parent="."] [node name="WallsAndShit" type="Node3D" parent="."]
@@ -454,26 +550,30 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.9, 6, -3.5)
[node name="OmniLight3D" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] [node name="OmniLight3D" type="OmniLight3D" parent="WallsAndShit/Chandelier2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0676376, -0.834157, 0.600262) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0676376, -0.834157, 0.600262)
light_color = Color(0.860136, 0.848595, 0.752131, 1) light_color = Color(0.860136, 0.848595, 0.752131, 1)
light_energy = 0.961 light_energy = 0.576
omni_range = 5.751 shadow_enabled = true
omni_range = 6.338
[node name="OmniLight3D2" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] [node name="OmniLight3D2" type="OmniLight3D" parent="WallsAndShit/Chandelier2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0676376, -0.834157, -0.548677) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0676376, -0.834157, -0.548677)
light_color = Color(0.860136, 0.848595, 0.752131, 1) light_color = Color(0.860136, 0.848595, 0.752131, 1)
light_energy = 0.961 light_energy = 0.576
omni_range = 5.751 shadow_enabled = true
omni_range = 6.338
[node name="OmniLight3D3" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] [node name="OmniLight3D3" type="OmniLight3D" parent="WallsAndShit/Chandelier2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.632596, -0.834157, -0.00643849) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.632596, -0.834157, -0.00643849)
light_color = Color(0.860136, 0.848595, 0.752131, 1) light_color = Color(0.860136, 0.848595, 0.752131, 1)
light_energy = 0.961 light_energy = 0.576
omni_range = 5.751 shadow_enabled = true
omni_range = 6.338
[node name="OmniLight3D4" type="OmniLight3D" parent="WallsAndShit/Chandelier2"] [node name="OmniLight3D4" type="OmniLight3D" parent="WallsAndShit/Chandelier2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.572049, -0.834157, 0.00770402) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.572049, -0.834157, 0.00770402)
light_color = Color(0.860136, 0.848595, 0.752131, 1) light_color = Color(0.860136, 0.848595, 0.752131, 1)
light_energy = 0.961 light_energy = 0.576
omni_range = 5.751 shadow_enabled = true
omni_range = 6.338
[node name="Bed_Twin12" parent="WallsAndShit" instance=ExtResource("21_77p6n")] [node name="Bed_Twin12" parent="WallsAndShit" instance=ExtResource("21_77p6n")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5.6, 0.3, -0.7) transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -5.6, 0.3, -0.7)
@@ -670,10 +770,21 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.60376, 0.0895298, -6.71063)
[node name="Stair_Interior_Rails2" parent="WallsAndShit" instance=ExtResource("42_isn6p")] [node name="Stair_Interior_Rails2" parent="WallsAndShit" instance=ExtResource("42_isn6p")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.185164, 0.0756873, -6.01873) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -0.185164, 0.0756873, -6.01873)
[node name="Lantern_Wall2" parent="WallsAndShit" instance=ExtResource("54_nrbqc")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -6.2387, 6.11833, -3.1478)
[node name="OmniLight3D" type="OmniLight3D" parent="WallsAndShit/Lantern_Wall2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.310703, 0.836766)
light_color = Color(0.873324, 0.836156, 0.57236, 1)
light_energy = 0.346
light_size = 0.031
light_bake_mode = 1
shadow_blur = 2.971
omni_range = 6.692
omni_attenuation = 0.486
[node name="NecessaryColliders" type="StaticBody3D" parent="."] [node name="NecessaryColliders" type="StaticBody3D" parent="."]
[node name="BalconyGround" type="CollisionShape3D" parent="NecessaryColliders"] [node name="BalconyGround" type="CollisionShape3D" parent="NecessaryColliders"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.41964, 2.97922, -3.36598) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.41964, 2.97922, -3.36598)
shape = SubResource("BoxShape3D_61s38") shape = SubResource("BoxShape3D_61s38")
[editable path="Meadow"]
+3 -3
View File
@@ -11,7 +11,7 @@
[ext_resource type="Script" uid="uid://bsl3en0gdt8ka" path="res://addons/proton_scatter/src/scatter_shape.gd" id="9_88tl0"] [ext_resource type="Script" uid="uid://bsl3en0gdt8ka" path="res://addons/proton_scatter/src/scatter_shape.gd" id="9_88tl0"]
[ext_resource type="Script" uid="uid://djsvn08xssx6k" path="res://addons/proton_scatter/src/shapes/sphere_shape.gd" id="10_g5616"] [ext_resource type="Script" uid="uid://djsvn08xssx6k" path="res://addons/proton_scatter/src/shapes/sphere_shape.gd" id="10_g5616"]
[ext_resource type="Script" uid="uid://d011g8ga6gea7" path="res://addons/proton_scatter/src/shapes/box_shape.gd" id="11_woep0"] [ext_resource type="Script" uid="uid://d011g8ga6gea7" path="res://addons/proton_scatter/src/shapes/box_shape.gd" id="11_woep0"]
[ext_resource type="Script" uid="uid://bfr4urrxjg8sm" path="res://addons/proton_scatter/src/cache/scatter_cache.gd" id="12_fdb1k"] [ext_resource type="Script" uid="uid://bfr4urrxjg8sm" path="res://addons/proton_scatter/src/cache/scatter_cache.gd" id="12_0swbt"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dss4m"] [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dss4m"]
albedo_color = Color(0.448364, 0.428649, 0.0977373, 1) albedo_color = Color(0.448364, 0.428649, 0.0977373, 1)
@@ -213,6 +213,6 @@ shape = SubResource("Resource_x2olw")
metadata/_custom_type_script = "uid://bsl3en0gdt8ka" metadata/_custom_type_script = "uid://bsl3en0gdt8ka"
[node name="ScatterCache" type="Node3D" parent="."] [node name="ScatterCache" type="Node3D" parent="."]
script = ExtResource("12_fdb1k") script = ExtResource("12_0swbt")
cache_file = "res://scenes/scatter_cache.res" cache_file = "res://addons/proton_scatter/cache/meadow_1404399578_scatter_cache.res"
metadata/_custom_type_script = "uid://bfr4urrxjg8sm" metadata/_custom_type_script = "uid://bfr4urrxjg8sm"
+2 -2
View File
@@ -72,10 +72,10 @@ tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("Door_8_Round2:rotation") tracks/0/path = NodePath("Door_8_Round2:rotation")
tracks/0/interp = 1 tracks/0/interp = 2
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5), "times": PackedFloat32Array(0, 0.9),
"transitions": PackedFloat32Array(1, 1), "transitions": PackedFloat32Array(1, 1),
"update": 0, "update": 0,
"values": [Vector3(0, -3.14159, 0), Vector3(0, -1.39626, 0)] "values": [Vector3(0, -3.14159, 0), Vector3(0, -1.39626, 0)]
Binary file not shown.
Binary file not shown.
+33 -23
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=27 format=4 uid="uid://dtbrnxalat1d4"] [gd_scene load_steps=29 format=4 uid="uid://dtbrnxalat1d4"]
[ext_resource type="PackedScene" uid="uid://wsu3b5udqtdu" path="res://meshes/village/Wall_UnevenBrick_Straight.gltf" id="1_4mrxx"] [ext_resource type="PackedScene" uid="uid://wsu3b5udqtdu" path="res://meshes/village/Wall_UnevenBrick_Straight.gltf" id="1_4mrxx"]
[ext_resource type="Texture2D" uid="uid://bgc5rl13dopuj" path="res://addons/proton_scatter/demos/assets/textures/sky_2.png" id="1_w7kh3"] [ext_resource type="Texture2D" uid="uid://bgc5rl13dopuj" path="res://addons/proton_scatter/demos/assets/textures/sky_2.png" id="1_w7kh3"]
@@ -9,13 +9,15 @@
[ext_resource type="PackedScene" uid="uid://7bhh6aas0sxr" path="res://meshes/village/Window_Wide_Round1.gltf" id="5_q5onr"] [ext_resource type="PackedScene" uid="uid://7bhh6aas0sxr" path="res://meshes/village/Window_Wide_Round1.gltf" id="5_q5onr"]
[ext_resource type="PackedScene" uid="uid://c3fv7wek4rjjt" path="res://meshes/village/Floor_WoodLight.gltf" id="6_jhx03"] [ext_resource type="PackedScene" uid="uid://c3fv7wek4rjjt" path="res://meshes/village/Floor_WoodLight.gltf" id="6_jhx03"]
[ext_resource type="PackedScene" uid="uid://cqm26jf01p8uv" path="res://scenes/portal_door.tscn" id="10_q5onr"] [ext_resource type="PackedScene" uid="uid://cqm26jf01p8uv" path="res://scenes/portal_door.tscn" id="10_q5onr"]
[ext_resource type="PackedScene" uid="uid://v2td8h7kmqic" path="res://meshes/interior/Bed_Twin2.gltf" id="13_7t5mc"]
[ext_resource type="Script" uid="uid://cw1r4c1d7beyv" path="res://addons/portals/scripts/portal_3d.gd" id="13_xo05s"] [ext_resource type="Script" uid="uid://cw1r4c1d7beyv" path="res://addons/portals/scripts/portal_3d.gd" id="13_xo05s"]
[ext_resource type="Material" uid="uid://dcfkcyddxkglf" path="res://addons/portals/materials/editor-preview-portal-material.tres" id="14_dss4m"] [ext_resource type="Material" uid="uid://dcfkcyddxkglf" path="res://addons/portals/materials/editor-preview-portal-material.tres" id="14_dss4m"]
[ext_resource type="Script" uid="uid://d2eiwbv6c3kcq" path="res://scripts/door_opener.gd" id="14_lakw3"]
[ext_resource type="Script" uid="uid://bxcel82b180o3" path="res://addons/portals/scripts/portal_boxmesh.gd" id="15_7t5mc"] [ext_resource type="Script" uid="uid://bxcel82b180o3" path="res://addons/portals/scripts/portal_boxmesh.gd" id="15_7t5mc"]
[ext_resource type="PackedScene" uid="uid://clxuoprslq8em" path="res://scenes/house_big.tscn" id="16_dss4m"] [ext_resource type="PackedScene" uid="uid://clxuoprslq8em" path="res://scenes/house_big.tscn" id="16_dss4m"]
[ext_resource type="Script" uid="uid://d2crarvkhd45r" path="res://scripts/player.gd" id="17_7t5mc"]
[ext_resource type="PackedScene" uid="uid://dc4ynch2n1ish" path="res://meshes/village/Roof_RoundTiles_4x4.gltf" id="22_kpybi"] [ext_resource type="PackedScene" uid="uid://dc4ynch2n1ish" path="res://meshes/village/Roof_RoundTiles_4x4.gltf" id="22_kpybi"]
[ext_resource type="PackedScene" uid="uid://b7mjoyryltilk" path="res://meshes/village/Roof_Front_Brick4.gltf" id="23_ctatt"] [ext_resource type="PackedScene" uid="uid://b7mjoyryltilk" path="res://meshes/village/Roof_Front_Brick4.gltf" id="23_ctatt"]
[ext_resource type="Script" uid="uid://d2crarvkhd45r" path="res://scripts/player.gd" id="23_kpybi"]
[sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_q5onr"] [sub_resource type="PanoramaSkyMaterial" id="PanoramaSkyMaterial_q5onr"]
panorama = ExtResource("1_w7kh3") panorama = ExtResource("1_w7kh3")
@@ -32,13 +34,11 @@ ambient_light_color = Color(0.939669, 0.875855, 0.802177, 1)
ambient_light_energy = 0.2 ambient_light_energy = 0.2
tonemap_mode = 3 tonemap_mode = 3
ssao_enabled = true ssao_enabled = true
ssao_intensity = 5.0 ssao_power = 0.75
ssil_enabled = true
fog_density = 0.0051 fog_density = 0.0051
fog_sky_affect = 0.23 fog_sky_affect = 0.23
adjustment_enabled = true
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_ctatt"]
radius = 0.4
height = 1.75
[sub_resource type="BoxShape3D" id="BoxShape3D_q5onr"] [sub_resource type="BoxShape3D" id="BoxShape3D_q5onr"]
size = Vector3(1.83496, 2.19373, 1.46497) size = Vector3(1.83496, 2.19373, 1.46497)
@@ -81,7 +81,12 @@ size = Vector3(1.5, 2.5, 1)
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_dss4m"] [sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_dss4m"]
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dss4m"]
radius = 0.2
height = 1.75
[node name="World" type="Node3D"] [node name="World" type="Node3D"]
metadata/movie_file = "captures/f_.avi"
[node name="WorldEnvironment" type="WorldEnvironment" parent="."] [node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_o8fc1") environment = SubResource("Environment_o8fc1")
@@ -92,19 +97,7 @@ light_color = Color(0.939669, 0.875855, 0.802177, 1)
light_energy = 2.0 light_energy = 2.0
light_bake_mode = 1 light_bake_mode = 1
shadow_enabled = true shadow_enabled = true
directional_shadow_blend_splits = true
[node name="CharacterBody3D" type="CharacterBody3D" parent="." node_paths=PackedStringArray("camera")]
transform = Transform3D(-0.658689, 0, 0.752415, 0, 1, 0, -0.752415, 0, -0.658689, 12.1193, 1.93814, -3.63533)
collision_layer = 3
script = ExtResource("23_kpybi")
camera = NodePath("Camera3D")
metadata/_edit_group_ = true
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
shape = SubResource("CapsuleShape3D_ctatt")
[node name="Camera3D" type="Camera3D" parent="CharacterBody3D"]
transform = Transform3D(1, 0, 2.98023e-08, 0, 1, 0, -2.98023e-08, 0, 1, 0, 0.7, 0)
[node name="Meadow" parent="." instance=ExtResource("3_jhx03")] [node name="Meadow" parent="." instance=ExtResource("3_jhx03")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.25, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.25, 0)
@@ -147,7 +140,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.2, 0
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0)
[node name="Window_Wide_Round12" parent="House_Small" instance=ExtResource("5_q5onr")] [node name="Window_Wide_Round12" parent="House_Small" instance=ExtResource("5_q5onr")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, -0.068238, 0)
[node name="Floor_WoodLight2" parent="House_Small" instance=ExtResource("6_jhx03")] [node name="Floor_WoodLight2" parent="House_Small" instance=ExtResource("6_jhx03")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.2) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -1.2)
@@ -170,7 +163,7 @@ light_bake_mode = 1
shadow_enabled = true shadow_enabled = true
[node name="Roof_RoundTiles_4x42" parent="House_Small" instance=ExtResource("22_kpybi")] [node name="Roof_RoundTiles_4x42" parent="House_Small" instance=ExtResource("22_kpybi")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.852654, 3.1, -2.21197) transform = Transform3D(-4.84364e-08, 0, 1, 0, 1, 0, -1.1081, 0, -4.37114e-08, 0.852654, 3.1, -2.21197)
[node name="Roof_Front_Brick42" parent="House_Small/Roof_RoundTiles_4x42" instance=ExtResource("23_ctatt")] [node name="Roof_Front_Brick42" parent="House_Small/Roof_RoundTiles_4x42" instance=ExtResource("23_ctatt")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.38419e-07, 0, 2.4) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.38419e-07, 0, 2.4)
@@ -178,6 +171,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -2.38419e-07, 0, 2.4)
[node name="Roof_Front_Brick43" parent="House_Small/Roof_RoundTiles_4x42" instance=ExtResource("23_ctatt")] [node name="Roof_Front_Brick43" parent="House_Small/Roof_RoundTiles_4x42" instance=ExtResource("23_ctatt")]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -4.76837e-07, 0, -2.1) transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -4.76837e-07, 0, -2.1)
[node name="Bed_Twin22" parent="House_Small" instance=ExtResource("13_7t5mc")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.253564, 0, -2.99754)
[node name="HouseBig" parent="." instance=ExtResource("16_dss4m")] [node name="HouseBig" parent="." instance=ExtResource("16_dss4m")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1000, 0, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1000, 0, 0)
@@ -186,6 +182,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 3.1, 0
collision_layer = 0 collision_layer = 0
collision_mask = 2 collision_mask = 2
monitorable = false monitorable = false
script = ExtResource("14_lakw3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="DoorOpener"] [node name="CollisionShape3D" type="CollisionShape3D" parent="DoorOpener"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05282, 0.739908) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.05282, 0.739908)
@@ -237,7 +234,7 @@ _teleport_area_path = NodePath("TeleportArea")
_teleport_collider_path = NodePath("TeleportArea/Collider") _teleport_collider_path = NodePath("TeleportArea/Collider")
portal_size = Vector2(1.5, 2.5) portal_size = Vector2(1.5, 2.5)
exit_portal = NodePath("../PortalSmall") exit_portal = NodePath("../PortalSmall")
portal_frame_width = 0.0 portal_frame_width = 1.0
viewport_size_mode = 0 viewport_size_mode = 0
view_direction = 1 view_direction = 1
portal_render_layer = 524288 portal_render_layer = 524288
@@ -268,5 +265,18 @@ shape = SubResource("BoxShape3D_7t5mc")
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"] [node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D"]
shape = SubResource("WorldBoundaryShape3D_dss4m") shape = SubResource("WorldBoundaryShape3D_dss4m")
[node name="CharacterBody3D" type="CharacterBody3D" parent="." node_paths=PackedStringArray("camera")]
transform = Transform3D(-0.524357, 0, 0.851498, 0, 1, 0, -0.851498, 0, -0.524357, 10.6968, 1.36224, -8.3989)
collision_layer = 3
script = ExtResource("17_7t5mc")
camera = NodePath("Camera3D")
metadata/_edit_group_ = true
[node name="Camera3D" type="Camera3D" parent="CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.925, 0)
[node name="CollisionShape3D" type="CollisionShape3D" parent="CharacterBody3D"]
shape = SubResource("CapsuleShape3D_dss4m")
[connection signal="body_entered" from="DoorOpener" to="House_Small/PortalDoor" method="open"] [connection signal="body_entered" from="DoorOpener" to="House_Small/PortalDoor" method="open"]
[connection signal="body_entered" from="DoorOpener" to="HouseBig" method="open_door"] [connection signal="body_entered" from="DoorOpener" to="HouseBig" method="open_door"]
+22
View File
@@ -0,0 +1,22 @@
extends Camera3D
@export_range(1, 100, 0.1, "suffix:s") var travel_time: float
@export var path: Path3D
var follower: PathFollow3D
@export var target: MeshInstance3D
func _ready() -> void:
assert (path != null)
follower = path.get_node("PathFollow3D")
assert(follower != null)
assert(target != null)
var t = get_tree().create_tween()
t.set_trans(Tween.TRANS_QUAD)
t.set_ease(Tween.EASE_IN_OUT)
t.tween_property(follower, "progress_ratio", 1, travel_time)
t.tween_callback(get_tree().quit.bind(0))
func _process(delta: float) -> void:
look_at(target.global_position)
global_position = follower.global_position
+1
View File
@@ -0,0 +1 @@
uid://co2pjpdo4nyto
+6
View File
@@ -0,0 +1,6 @@
extends Area3D
func _process(delta: float) -> void:
if Input.is_key_pressed(KEY_E):
body_entered.emit(null)
+1
View File
@@ -0,0 +1 @@
uid://d2eiwbv6c3kcq
+60 -36
View File
@@ -2,55 +2,79 @@ extends CharacterBody3D
@export var camera: Camera3D @export var camera: Camera3D
@export var SPEED = 4.0 var SPEED = 2.0
const JUMP_VELOCITY = 4.5 const JUMP_VELOCITY = 4.5
const MOUSE_SENSITIVITY = 0.004 const MOUSE_SENSITIVITY = 0.004
const ROTATION_SPEED := 4.0 # How fast to interpolate (higher = snappier)
var target_rotation := Vector2.ZERO # x = pitch, y = yaw
func _ready() -> void: func _ready() -> void:
assert(camera != null, "Forgot to set camera in editor") assert(camera != null, "Forgot to set camera in editor")
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
## Implements [member Portal3D.ON_TELEPORT_CALLBACK] # Initialize target rotation from current rotation
func on_teleport(portal: Portal3D) -> void: target_rotation.y = rotation.y
print("on_teleport: player position - ",self.global_position) target_rotation.x = camera.rotation.x
func _unhandled_input(event: InputEvent) -> void: func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion: if event is InputEventMouseMotion and Input.mouse_mode == Input.MOUSE_MODE_CAPTURED:
if Input.mouse_mode == Input.MOUSE_MODE_CAPTURED: target_rotation.y -= event.relative.x * MOUSE_SENSITIVITY
rotate_y(-event.screen_relative.x * MOUSE_SENSITIVITY) target_rotation.x -= event.relative.y * MOUSE_SENSITIVITY
camera.rotate_x(-event.screen_relative.y * MOUSE_SENSITIVITY) target_rotation.x = clamp(target_rotation.x, deg_to_rad(-80), deg_to_rad(80))
camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-80), deg_to_rad(80))
func _process(delta: float) -> void:
# Smoothly interpolate current rotation toward target
rotation.y = lerp_angle(rotation.y, target_rotation.y, delta * ROTATION_SPEED)
camera.rotation.x = lerp_angle(camera.rotation.x, target_rotation.x, delta * ROTATION_SPEED)
const ACCELERATION := 10.0
const DECELERATION := 6.0
var input_direction := Vector3.ZERO
var target_velocity := Vector3.ZERO
func _get_input_direction() -> Vector3:
var direction := Vector3.ZERO
if Input.is_key_pressed(KEY_LEFT) or Input.is_key_pressed(KEY_A):
direction.x -= 1
if Input.is_key_pressed(KEY_RIGHT) or Input.is_key_pressed(KEY_D):
direction.x += 1
if Input.is_key_pressed(KEY_UP) or Input.is_key_pressed(KEY_W):
direction.z += 1
if Input.is_key_pressed(KEY_DOWN) or Input.is_key_pressed(KEY_S):
direction.z -= 1
return direction.normalized()
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
var right: Vector3 = (global_transform.basis.x * Vector3(1, 0, 1)).normalized() # Get input direction relative to player orientation
var forward: Vector3 = (-global_transform.basis.z * Vector3(1, 0, 1)).normalized() input_direction = _get_input_direction()
var has_input = false
velocity.x = 0
velocity.z = 0
if Input.is_key_pressed(KEY_LEFT) or Input.is_key_pressed(KEY_A):
has_input = true
velocity -= right
if Input.is_key_pressed(KEY_RIGHT) or Input.is_key_pressed(KEY_D):
has_input = true
velocity += right
if Input.is_key_pressed(KEY_UP) or Input.is_key_pressed(KEY_W):
has_input = true
velocity += forward
if Input.is_key_pressed(KEY_DOWN) or Input.is_key_pressed(KEY_S):
has_input = true
velocity -= forward
if has_input: var basis := global_transform.basis
var normalized_horizontal_velocity = Vector2(velocity.x, velocity.z).normalized() var forward := -basis.z.normalized()
velocity.x = normalized_horizontal_velocity.x * SPEED var right := basis.x.normalized()
velocity.z = normalized_horizontal_velocity.y * SPEED
# Desired horizontal movement direction in world space
var desired_velocity : Vector3 = (right * input_direction.x + forward * input_direction.z) * SPEED
desired_velocity.y = 0 # Only horizontal
# Smooth acceleration/deceleration
var accel := DECELERATION if input_direction == Vector3.ZERO else ACCELERATION
target_velocity.x = lerp(target_velocity.x, desired_velocity.x, accel * delta)
target_velocity.z = lerp(target_velocity.z, desired_velocity.z, accel * delta)
# Preserve existing vertical velocity
if not is_on_floor(): if not is_on_floor():
velocity += get_gravity() * delta target_velocity.y += get_gravity().y * delta
else:
if Input.is_action_just_pressed("ui_accept") and is_on_floor(): target_velocity.y = 0
velocity.y = JUMP_VELOCITY if Input.is_action_just_pressed("ui_accept"):
target_velocity.y = JUMP_VELOCITY
# Apply movement
velocity = target_velocity
move_and_slide() move_and_slide()