Navigation

pull/2/head
Sascha 2024-05-23 09:57:31 +07:00
parent 50c3bd6b3d
commit c44dac7675
5 changed files with 9075 additions and 171 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=3 uid="uid://b1i4juq2u7pwk"]
[gd_scene load_steps=10 format=3 uid="uid://b1i4juq2u7pwk"]
[ext_resource type="Environment" uid="uid://d31wkt76cft8k" path="res://resources/world_environment.tres" id="1_03qki"]
[ext_resource type="Script" path="res://scripts/game_manager.gd" id="1_kvi4c"]
@ -10,11 +10,8 @@
[ext_resource type="MeshLibrary" uid="uid://bs0yqy7xhugol" path="res://resources/level_mesh_library.tres" id="9_dr0le"]
[sub_resource type="NavigationMesh" id="NavigationMesh_3mbqm"]
vertices = PackedVector3Array(-25.5, 0.5, -8.5, -25.5, 0.5, 20.5, 23.5, 0.5, 20.5, 23.5, 0.5, -8.5)
polygons = [PackedInt32Array(3, 2, 0), PackedInt32Array(0, 2, 1)]
[sub_resource type="PlaneMesh" id="PlaneMesh_cb1cv"]
size = Vector2(100, 100)
vertices = PackedVector3Array(-21.5, 0.4, 13.5, -16, 0.4, 13.5, -16, 0.4, 10.75, -21.5, 0.4, 13.5, -16, 0.4, 10.75, -15.25, 0.4, 10, -13, 0.4, 2, -14, 0.4, 1.5, -21.5, 0.4, -1.5, -14, 0.4, 1.5, -14, 0.4, -1.5, -21.5, 0.4, -1.5, -15.25, 0.4, 10, -13, 0.4, 10, -13, 0.4, 2, -12, 0.4, -1.5, -12, 0.4, 0, 14, 0.4, 0, 14, 0.4, -1.5, 18, 0.4, 10.75, 18, 0.4, 13.5, 20, 0.4, 13.5, 17.5, 0.4, 10, 18, 0.4, 10.75, 20, 0.4, 13.5, 20.25, 0.4, -1.5, 16, 0.4, 1.5, 15.5, 0.4, 2, 20.25, 0.4, -1.5, 16, 0.4, -1.5, 16, 0.4, 1.5, -13, 0.4, 10, 17.5, 0.4, 10, 15.5, 0.4, 2, -13, 0.4, 2, -14, 0.4, 12, -14, 0.4, 13.5, 16, 0.4, 13.5, 16, 0.4, 12)
polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(4, 3, 5), PackedInt32Array(5, 3, 6), PackedInt32Array(6, 3, 7), PackedInt32Array(7, 3, 8), PackedInt32Array(11, 10, 9), PackedInt32Array(14, 13, 12), PackedInt32Array(18, 17, 15), PackedInt32Array(15, 17, 16), PackedInt32Array(21, 20, 19), PackedInt32Array(23, 22, 24), PackedInt32Array(24, 22, 27), PackedInt32Array(24, 27, 26), PackedInt32Array(24, 26, 25), PackedInt32Array(30, 29, 28), PackedInt32Array(34, 33, 31), PackedInt32Array(31, 33, 32), PackedInt32Array(38, 37, 35), PackedInt32Array(35, 37, 36)]
[node name="Game" type="Node3D"]
@ -38,6 +35,9 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -17.852, 1, 6.862)
[node name="Skeleton_Warrior_new" parent="." node_paths=PackedStringArray("nearest_player") instance=ExtResource("8_b6x6f")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 20, 1, 6)
speed = 4.0
acceleration = 4.0
jump_speed = 8.0
nearest_player = NodePath("../Knight")
[node name="torch_mounted" parent="." instance=ExtResource("8_8d1n4")]
@ -61,24 +61,22 @@ transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -6.616
[node name="torch_mounted7" parent="." instance=ExtResource("8_8d1n4")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -12.6168, 2.9024, 10.7441)
[node name="Level" type="GridMap" parent="."]
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
navigation_mesh = SubResource("NavigationMesh_3mbqm")
[node name="Level" type="GridMap" parent="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
mesh_library = ExtResource("9_dr0le")
bake_navigation = true
data = {
"cells": PackedInt32Array(65532, 0, 0, 65530, 0, 0, 65528, 0, 5, 0, 0, 0, 2, 0, 0, 6, 0, 0, 65528, 5, 5, 65529, 5, 0, 65533, 5, 0, 65535, 5, 0, 1, 5, 0, 5, 5, 0, 7, 5, 0, 65534, 0, 1, 4, 0, 2, 65531, 5, 3, 3, 5, 4, 49, 28, 4, 65527, 0, 5, 65527, 1, 5, 65527, 2, 5, 65528, 3, 5, 65527, 3, 5, 65527, 4, 5, 65527, 5, 5, 65528, 1, 5, 65528, 2, 5, 65528, 4, 5, 65526, 0, 5, 65526, 1, 5, 65526, 2, 5, 65526, 3, 5, 65526, 4, 5, 65526, 5, 5, 65529, 1, 5, 65529, 2, 5, 65529, 3, 5, 65529, 4, 5, 65530, 1, 5, 65531, 1, 5, 65532, 1, 5, 65533, 1, 5, 65534, 1, 5, 65535, 1, 5, 0, 1, 5, 1, 1, 5, 2, 1, 5, 3, 1, 5, 4, 1, 5, 5, 1, 5, 6, 1, 5, 7, 1, 5, 8, 1, 5, 9, 1, 5, 10, 0, 1441792, 10, 1, 5, 65530, 2, 5, 65531, 2, 5, 65532, 2, 5, 65533, 2, 5, 65534, 2, 5, 65535, 2, 5, 0, 2, 5, 0, 3, 5, 1, 3, 5, 2, 3, 5, 3, 3, 5, 4, 3, 5, 4, 2, 5, 3, 2, 5, 2, 2, 5, 1, 2, 5, 5, 2, 5, 6, 2, 5, 7, 2, 5, 8, 2, 5, 9, 2, 5, 10, 2, 1441792, 10, 3, 5, 9, 3, 5, 8, 3, 5, 7, 3, 5, 6, 3, 5, 5, 3, 5, 65535, 3, 5, 65534, 3, 5, 65533, 3, 5, 65530, 3, 5, 65531, 3, 5, 65532, 3, 5, 65530, 4, 5, 65531, 4, 5, 65532, 4, 5, 65533, 4, 5, 65534, 4, 5, 65535, 4, 5, 1, 4, 5, 0, 4, 5, 2, 4, 5, 3, 4, 5, 4, 4, 5, 5, 4, 5, 6, 4, 5, 7, 4, 5, 8, 4, 5, 9, 4, 5, 10, 4, 1441792, 10, 5, 5, 11, 0, 5, 11, 1, 5, 11, 2, 5, 11, 3, 5, 11, 4, 5, 11, 5, 5, 65529, 65535, 1441792, 65528, 6, 1441792, 65527, 7, 655360, 65525, 7, 655360, 65528, 65534, 655360, 65524, 6, 1048576, 65524, 4, 1048576, 65524, 2, 1048576, 65524, 0, 1048576, 65526, 65534, 0, 8, 6, 1048576, 9, 7, 0, 10, 6, 1441792, 7, 65535, 1441792, 8, 65534, 655360, 10, 65534, 655360)
}
[node name="Floors" type="GridMap" parent="."]
[node name="Floors" type="GridMap" parent="NavigationRegion3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
mesh_library = ExtResource("7_pv7jr")
bake_navigation = true
data = {
"cells": PackedInt32Array(9, 65535, 0, 9, 0, 0, 9, 1, 0, 9, 2, 0, 9, 3, 0, 9, 4, 0, 9, 5, 0, 9, 6, 0, 8, 6, 0, 8, 5, 0, 8, 4, 0, 8, 3, 0, 8, 2, 0, 8, 1, 0, 8, 0, 0, 8, 65535, 0, 7, 65535, 0, 7, 0, 0, 7, 1, 0, 7, 2, 0, 7, 3, 0, 7, 4, 0, 7, 5, 0, 7, 6, 0, 6, 6, 0, 6, 5, 0, 6, 4, 0, 6, 3, 0, 6, 2, 0, 6, 1, 0, 6, 0, 0, 6, 65535, 0, 5, 65535, 0, 5, 0, 0, 5, 1, 0, 5, 2, 0, 5, 3, 0, 5, 4, 0, 5, 5, 0, 5, 6, 0, 4, 6, 0, 4, 5, 0, 4, 4, 0, 4, 3, 0, 4, 2, 0, 4, 1, 0, 4, 0, 0, 4, 65535, 0, 3, 6, 0, 2, 6, 0, 1, 6, 0, 0, 6, 0, 65535, 6, 0, 65534, 6, 0, 65533, 6, 0, 65532, 6, 0, 65531, 6, 0, 65530, 6, 0, 65529, 6, 0, 65528, 6, 0, 65527, 6, 0, 65526, 6, 0, 65525, 6, 0, 65525, 5, 0, 65526, 5, 0, 65527, 5, 0, 65528, 5, 0, 65529, 5, 0, 65530, 5, 0, 65531, 5, 0, 65532, 5, 0, 65533, 5, 0, 65534, 5, 0, 65535, 5, 0, 0, 5, 0, 1, 5, 0, 2, 5, 0, 3, 5, 0, 3, 4, 0, 2, 4, 0, 1, 4, 0, 0, 4, 0, 65535, 4, 0, 65534, 4, 0, 65533, 4, 0, 65530, 4, 0, 65529, 4, 0, 65528, 4, 0, 65527, 4, 0, 65526, 4, 0, 65525, 4, 0, 65531, 4, 0, 65532, 4, 0, 0, 3, 0, 1, 3, 0, 2, 3, 0, 3, 3, 0, 3, 2, 0, 1, 2, 0, 65535, 3, 0, 2, 2, 0, 65534, 3, 0, 65533, 3, 0, 65535, 2, 0, 3, 1, 0, 2, 1, 0, 1, 1, 0, 0, 1, 0, 0, 2, 0, 65534, 2, 0, 65533, 2, 0, 65532, 2, 0, 65532, 3, 0, 65531, 3, 0, 65532, 1, 0, 65531, 1, 0, 65531, 2, 0, 65530, 2, 0, 65530, 3, 0, 65530, 1, 0, 65529, 1, 0, 65529, 2, 0, 65529, 3, 0, 65528, 3, 0, 65528, 2, 0, 65528, 1, 0, 65527, 2, 0, 65527, 3, 0, 65526, 3, 0, 65525, 3, 0, 65525, 2, 0, 65526, 2, 0, 65526, 1, 0, 65527, 1, 0, 65525, 1, 0, 65525, 0, 0, 65526, 0, 0, 65527, 0, 0, 65528, 0, 0, 65529, 0, 0, 65530, 0, 0, 65531, 0, 0, 65532, 0, 0, 65533, 0, 0, 65534, 0, 0, 65535, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 3, 0, 0, 3, 65535, 0, 2, 65535, 0, 1, 65535, 0, 0, 65535, 0, 65535, 1, 0, 65534, 1, 0, 65533, 1, 0, 65535, 65535, 0, 65534, 65535, 0, 65533, 65535, 0, 65532, 65535, 0, 65531, 65535, 0, 65530, 65535, 0, 65529, 65535, 0, 65528, 65535, 0, 65527, 65535, 0, 65526, 65535, 0, 65525, 65535, 0, 10, 6, 1441792, 10, 5, 1441792, 10, 4, 1441792, 10, 3, 1441792, 10, 2, 1441792, 10, 1, 1441792, 10, 0, 1441792, 10, 65535, 1441792)
}
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
navigation_mesh = SubResource("NavigationMesh_3mbqm")
[node name="MeshInstance3D" type="MeshInstance3D" parent="NavigationRegion3D"]
transform = Transform3D(0.5, 0, 0, 0, 1, 0, 0, 0, 0.3, -1, 0, 6)
mesh = SubResource("PlaneMesh_cb1cv")
[connection signal="bake_finished" from="NavigationRegion3D" to="Skeleton_Warrior_new" method="_on_navigation_region_3d_bake_finished"]

@ -1,4 +1,4 @@
[gd_scene load_steps=34 format=3 uid="uid://670weiu5lj4u"]
[gd_scene load_steps=33 format=3 uid="uid://670weiu5lj4u"]
[ext_resource type="PackedScene" uid="uid://dkdvaoo1jowo2" path="res://resources/models/skeletons/Skeleton_Warrior_new.glb" id="1_1tv7o"]
[ext_resource type="Script" path="res://scripts/skeleton.gd" id="2_gn4pp"]
@ -100,11 +100,7 @@ advance_mode = 2
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_liaip"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xvqtq"]
switch_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hnd51"]
advance_mode = 2
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_7v7qh"]
@ -119,15 +115,15 @@ states/Jump_Land/position = Vector2(900, 283)
states/Jump_Start/node = SubResource("AnimationNodeAnimation_n2bl3")
states/Jump_Start/position = Vector2(658, 283)
states/Skeletons_Awaken_Floor_Long/node = SubResource("AnimationNodeAnimation_lp4nb")
states/Skeletons_Awaken_Floor_Long/position = Vector2(284, 100)
states/Start/position = Vector2(30, 100)
states/Skeletons_Awaken_Floor_Long/position = Vector2(-20, -2.186)
states/Start/position = Vector2(284, 100)
states/Unarmed_Melee_Attack_Punch_A/node = SubResource("AnimationNodeAnimation_ou2cq")
states/Unarmed_Melee_Attack_Punch_A/position = Vector2(284, -2.186)
"states/Unarmed_Melee_Attack_Punch_A 2/node" = SubResource("AnimationNodeAnimation_m8va5")
"states/Unarmed_Melee_Attack_Punch_A 2/position" = Vector2(583, -22.186)
states/Unarmed_Melee_Attack_Punch_B/node = SubResource("AnimationNodeAnimation_u8v08")
states/Unarmed_Melee_Attack_Punch_B/position = Vector2(831, -14.186)
transitions = ["IWR", "Death_A", SubResource("AnimationNodeStateMachineTransition_0pn5a"), "Death_A", "End", SubResource("AnimationNodeStateMachineTransition_u1hnl"), "IWR", "Jump_Start", SubResource("AnimationNodeStateMachineTransition_4j7ud"), "Jump_Start", "Jump_Idle", SubResource("AnimationNodeStateMachineTransition_mgjn7"), "Jump_Idle", "Jump_Land", SubResource("AnimationNodeStateMachineTransition_eh75m"), "Jump_Land", "IWR", SubResource("AnimationNodeStateMachineTransition_qllfg"), "IWR", "Jump_Idle", SubResource("AnimationNodeStateMachineTransition_vq1x0"), "Unarmed_Melee_Attack_Punch_A", "IWR", SubResource("AnimationNodeStateMachineTransition_yp0xf"), "IWR", "Unarmed_Melee_Attack_Punch_A", SubResource("AnimationNodeStateMachineTransition_ykhdv"), "IWR", "Unarmed_Melee_Attack_Punch_A 2", SubResource("AnimationNodeStateMachineTransition_bsx0c"), "Unarmed_Melee_Attack_Punch_A 2", "IWR", SubResource("AnimationNodeStateMachineTransition_hebuk"), "IWR", "Unarmed_Melee_Attack_Punch_B", SubResource("AnimationNodeStateMachineTransition_138r8"), "Unarmed_Melee_Attack_Punch_B", "IWR", SubResource("AnimationNodeStateMachineTransition_8a1wb"), "Start", "Skeletons_Awaken_Floor_Long", SubResource("AnimationNodeStateMachineTransition_liaip"), "Skeletons_Awaken_Floor_Long", "IWR", SubResource("AnimationNodeStateMachineTransition_xvqtq")]
transitions = ["IWR", "Death_A", SubResource("AnimationNodeStateMachineTransition_0pn5a"), "Death_A", "End", SubResource("AnimationNodeStateMachineTransition_u1hnl"), "IWR", "Jump_Start", SubResource("AnimationNodeStateMachineTransition_4j7ud"), "Jump_Start", "Jump_Idle", SubResource("AnimationNodeStateMachineTransition_mgjn7"), "Jump_Idle", "Jump_Land", SubResource("AnimationNodeStateMachineTransition_eh75m"), "Jump_Land", "IWR", SubResource("AnimationNodeStateMachineTransition_qllfg"), "IWR", "Jump_Idle", SubResource("AnimationNodeStateMachineTransition_vq1x0"), "Unarmed_Melee_Attack_Punch_A", "IWR", SubResource("AnimationNodeStateMachineTransition_yp0xf"), "IWR", "Unarmed_Melee_Attack_Punch_A", SubResource("AnimationNodeStateMachineTransition_ykhdv"), "IWR", "Unarmed_Melee_Attack_Punch_A 2", SubResource("AnimationNodeStateMachineTransition_bsx0c"), "Unarmed_Melee_Attack_Punch_A 2", "IWR", SubResource("AnimationNodeStateMachineTransition_hebuk"), "IWR", "Unarmed_Melee_Attack_Punch_B", SubResource("AnimationNodeStateMachineTransition_138r8"), "Unarmed_Melee_Attack_Punch_B", "IWR", SubResource("AnimationNodeStateMachineTransition_8a1wb"), "Start", "IWR", SubResource("AnimationNodeStateMachineTransition_hnd51")]
graph_offset = Vector2(-318, -97.186)
[node name="Skeleton_Warrior_new" instance=ExtResource("1_1tv7o")]
@ -142,132 +138,49 @@ avoidance_enabled = true
debug_enabled = true
[node name="Skeleton3D" parent="Rig" index="0"]
bones/0/position = Vector3(-8.88257e-26, 0.00016468, -5.63675e-12)
bones/0/rotation = Quaternion(-8.55849e-09, -0.000274706, -1.25818e-11, 1)
bones/1/position = Vector3(1.16498e-18, 0.36874, 1.8325e-15)
bones/1/rotation = Quaternion(0.000374448, 0.0429939, 2.04545e-05, 0.999075)
bones/1/scale = Vector3(1, 1, 1)
bones/2/position = Vector3(5.98822e-12, 0.191978, -2.81141e-12)
bones/2/rotation = Quaternion(0.000447967, 0.000452675, -5.76011e-05, 1)
bones/2/scale = Vector3(1, 1, 1)
bones/3/position = Vector3(8.41451e-12, 0.374988, 8.01072e-11)
bones/3/rotation = Quaternion(0.000169429, 8.68339e-05, -1.17592e-05, 1)
bones/3/scale = Vector3(1, 1, 1)
bones/4/position = Vector3(0.211994, 0.134088, -0.000186638)
bones/4/rotation = Quaternion(-0.551568, -0.0578139, -0.640617, 0.531074)
bones/4/scale = Vector3(0.999999, 0.999999, 1)
bones/5/position = Vector3(4.31927e-08, 0.241897, -1.73409e-07)
bones/5/rotation = Quaternion(2.72937e-07, 5.75412e-08, -0.510739, 0.859736)
bones/5/scale = Vector3(1, 1, 1)
bones/6/position = Vector3(1.45841e-08, 0.260044, -2.31925e-08)
bones/6/rotation = Quaternion(-2.291e-07, 3.91274e-08, 0.0266581, 0.999645)
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0)
bones/0/rotation = Quaternion(-8.55713e-09, 1.20432e-07, -2.0611e-15, 1)
bones/1/rotation = Quaternion(-1.75564e-15, -1.03317e-07, 2.7788e-22, 1)
bones/4/rotation = Quaternion(-0.514124, -0.485465, -0.485465, 0.514124)
bones/5/rotation = Quaternion(2.45793e-07, -7.51439e-08, -0.0552965, 0.99847)
bones/6/rotation = Quaternion(-2.35585e-07, 4.61589e-09, 0.0266581, 0.999645)
bones/6/scale = Vector3(1, 1, 1)
bones/7/position = Vector3(-7.41079e-09, 0.0738259, -1.11218e-08)
bones/7/rotation = Quaternion(-0.319254, -0.338777, 0.146142, 0.872897)
bones/7/scale = Vector3(1, 1, 1)
bones/8/position = Vector3(3.33048e-10, 0.0961252, -0.0575)
bones/8/rotation = Quaternion(0.00100126, 0.00138497, -0.701836, 0.712337)
bones/8/scale = Vector3(1, 1, 1)
bones/9/position = Vector3(-0.211922, 0.134052, -0.00016725)
bones/9/rotation = Quaternion(-0.61033, 0.0777798, 0.615196, 0.492931)
bones/9/scale = Vector3(0.999999, 0.999999, 1)
bones/10/position = Vector3(-4.05231e-08, 0.241897, -5.50534e-08)
bones/10/rotation = Quaternion(2.43295e-07, -8.08935e-08, 0.533138, 0.846028)
bones/10/scale = Vector3(1, 1, 1)
bones/11/position = Vector3(-3.90794e-08, 0.260044, 1.79683e-08)
bones/11/rotation = Quaternion(-2.17192e-07, -1.25041e-08, -0.0266581, 0.999645)
bones/8/rotation = Quaternion(1.0645e-07, -5.81713e-08, -0.707107, 0.707107)
bones/10/rotation = Quaternion(2.4384e-07, 3.9741e-08, 0.0552965, 0.99847)
bones/11/rotation = Quaternion(-2.35588e-07, -4.60716e-09, -0.0266581, 0.999645)
bones/11/scale = Vector3(1, 1, 1)
bones/12/position = Vector3(-1.48269e-08, 0.0738259, -6.47978e-08)
bones/12/rotation = Quaternion(-0.318388, 0.31501, -0.227761, 0.864594)
bones/12/scale = Vector3(1, 1, 1)
bones/13/position = Vector3(-2.09619e-08, 0.0961251, -0.0575)
bones/13/rotation = Quaternion(0.00363479, 0.00432289, 0.702477, 0.711684)
bones/13/scale = Vector3(1, 1, 1)
bones/14/position = Vector3(-5.44906e-12, 0.268797, 9.37624e-11)
bones/14/rotation = Quaternion(-0.000509399, -0.0315879, -2.82339e-05, 0.999501)
bones/16/position = Vector3(0.170945, 0.113587, 0.00038744)
bones/16/rotation = Quaternion(0.989318, 0.0833347, 0.0786926, 0.0900742)
bones/16/scale = Vector3(1, 1, 1)
bones/17/position = Vector3(3.91002e-08, 0.227078, 4.52677e-10)
bones/17/rotation = Quaternion(0.398851, 6.59386e-08, -2.63228e-07, 0.917016)
bones/17/scale = Vector3(1, 1, 1)
bones/18/position = Vector3(4.43067e-08, 0.149437, -7.39573e-09)
bones/18/rotation = Quaternion(-0.623855, -0.199775, 0.0773661, 0.751605)
bones/18/scale = Vector3(1, 1, 0.999999)
bones/19/position = Vector3(-7.05564e-09, 0.16565, 2.69141e-08)
bones/19/rotation = Quaternion(-2.46973e-06, 0.920148, -0.39157, 9.81341e-07)
bones/19/scale = Vector3(1, 0.999998, 1)
bones/20/position = Vector3(-0.170945, 0.113587, -0.000387412)
bones/20/rotation = Quaternion(0.991256, -0.0333826, 0.0296441, 0.124172)
bones/20/scale = Vector3(1, 1, 1)
bones/21/position = Vector3(-9.5267e-09, 0.227077, -1.41947e-08)
bones/21/rotation = Quaternion(0.44455, -6.60445e-08, 3.10624e-07, 0.895754)
bones/21/scale = Vector3(1, 1, 1)
bones/22/position = Vector3(1.62477e-08, 0.149437, 6.90459e-09)
bones/22/rotation = Quaternion(-0.648442, 0.111942, -0.0238633, 0.752611)
bones/22/scale = Vector3(1, 1, 0.999999)
bones/23/position = Vector3(7.42921e-09, 0.16565, 2.47748e-08)
bones/23/rotation = Quaternion(-8.90125e-05, 0.920223, -0.391395, 2.03397e-05)
bones/23/scale = Vector3(1, 0.999998, 1)
bones/24/position = Vector3(0.170945, 0.292317, 0.575819)
bones/13/rotation = Quaternion(1.06567e-07, 5.80546e-08, 0.707107, 0.707107)
bones/16/rotation = Quaternion(0.999849, -6.67777e-08, -6.59708e-08, 0.0173739)
bones/17/rotation = Quaternion(0.106227, 7.68414e-08, -7.3606e-08, 0.994342)
bones/18/rotation = Quaternion(-0.45524, 7.50525e-08, -3.83738e-08, 0.890369)
bones/19/rotation = Quaternion(-1.02151e-08, 0.920355, -0.391084, 1.792e-07)
bones/20/rotation = Quaternion(0.999849, 6.73721e-08, 1.00173e-07, 0.0173739)
bones/21/rotation = Quaternion(0.106227, -7.67146e-08, 7.47885e-08, 0.994342)
bones/22/rotation = Quaternion(-0.45524, 7.50524e-08, -3.83739e-08, 0.890369)
bones/23/rotation = Quaternion(4.8837e-08, 0.920355, -0.391084, 4.023e-08)
bones/24/rotation = Quaternion(0.707107, -2.25334e-07, -5.00237e-08, 0.707107)
bones/24/scale = Vector3(1, 1, 1)
bones/25/position = Vector3(0.202061, 0.0272488, 0.206708)
bones/25/rotation = Quaternion(-0.708329, -7.24645e-08, -7.27419e-08, 0.705882)
bones/25/scale = Vector3(1, 1, 1)
bones/26/position = Vector3(-8.21946e-10, 0.362833, -6.6892e-10)
bones/26/rotation = Quaternion(-7.43126e-08, 1.39577e-08, 0.98583, -0.16775)
bones/27/position = Vector3(-4.35676e-08, 0.213436, -1.25734e-08)
bones/27/rotation = Quaternion(-1.33425e-07, 0.391084, 0.920355, 2.12388e-08)
bones/27/scale = Vector3(1, 1, 1)
bones/28/position = Vector3(2.54127e-08, 0.16565, 4.98054e-10)
bones/28/rotation = Quaternion(-0.391084, -1.93048e-08, -4.70849e-08, 0.920355)
bones/28/scale = Vector3(1, 1, 1)
bones/29/position = Vector3(4.45953e-08, 0.16565, -1.04149e-08)
bones/29/rotation = Quaternion(1, -1.45e-08, 1.98741e-07, -1.03437e-07)
bones/29/scale = Vector3(1, 1, 1)
bones/30/position = Vector3(-1.01846e-08, 1.40184e-08, -1.90178e-08)
bones/30/rotation = Quaternion(4.03838e-08, -6.75546e-12, -1.77594e-08, 1)
bones/31/position = Vector3(-0.170945, 0.292317, 0.575819)
bones/31/rotation = Quaternion(0.707107, -3.427e-08, 1.4104e-07, 0.707107)
bones/27/rotation = Quaternion(-1.43895e-07, 0.391084, 0.920355, 1.70948e-08)
bones/28/rotation = Quaternion(-0.391084, -3.33945e-08, -4.91559e-08, 0.920355)
bones/31/scale = Vector3(1, 1, 1)
bones/32/position = Vector3(-0.170945, 0.0264259, 0.242991)
bones/32/rotation = Quaternion(-0.704394, -7.29021e-08, -7.23108e-08, 0.709809)
bones/32/scale = Vector3(1, 1, 1)
bones/33/position = Vector3(1.26237e-08, 0.362833, -4.99246e-10)
bones/33/rotation = Quaternion(-9.3608e-08, -8.39706e-09, 0.99485, 0.101363)
bones/34/position = Vector3(-3.50967e-09, 0.213436, -1.62077e-08)
bones/34/rotation = Quaternion(-1.46995e-07, 0.391084, 0.920355, 2.40987e-08)
bones/34/scale = Vector3(1, 1, 1)
bones/35/position = Vector3(-8.98631e-09, 0.16565, 1.71451e-08)
bones/35/rotation = Quaternion(-0.391084, -3.11398e-08, -5.81745e-08, 0.920355)
bones/34/rotation = Quaternion(-1.43895e-07, 0.391084, 0.920355, 1.70948e-08)
bones/35/rotation = Quaternion(-0.391084, -3.33945e-08, -4.91559e-08, 0.920355)
bones/35/scale = Vector3(1, 1, 1)
bones/36/position = Vector3(5.96214e-09, 0.16565, 1.1454e-08)
bones/36/rotation = Quaternion(1, -1.45307e-09, 1.93305e-07, -8.74967e-08)
bones/36/scale = Vector3(1, 1, 1)
bones/37/position = Vector3(3.95559e-09, -3.98172e-09, -5.65785e-09)
bones/37/rotation = Quaternion(-7.69019e-10, 8.2907e-12, -1.77544e-08, 1)
bones/37/scale = Vector3(1, 1, 1)
bones/38/position = Vector3(0.453379, 1.10598, -0.589302)
bones/38/rotation = Quaternion(-0.707107, 6.4707e-05, 6.4707e-05, 0.707107)
bones/39/position = Vector3(0.520812, 0.771528, -0.0570328)
bones/39/rotation = Quaternion(0.795432, 0.00176498, 0.606041, 0.000194104)
bones/39/scale = Vector3(1, 1, 1)
bones/40/position = Vector3(-0.45384, 1.10588, -0.588869)
bones/40/rotation = Quaternion(-0.707107, 6.4707e-05, 6.4707e-05, 0.707107)
bones/41/position = Vector3(-0.510786, 0.771528, 0.0601801)
bones/41/rotation = Quaternion(-0.759155, 0.00169655, 0.650908, -0.000372958)
bones/41/scale = Vector3(1, 1, 1)
bones/38/rotation = Quaternion(-0.707107, -7.01241e-08, -7.01241e-08, 0.707107)
bones/40/rotation = Quaternion(-0.707107, -7.01241e-08, -7.01241e-08, 0.707107)
bones/41/rotation = Quaternion(-0.5, 0.5, 0.5, 0.5)
[node name="Skeleton_Warrior_Helmet" parent="Rig/Skeleton3D" index="0"]
transform = Transform3D(0.999727, 0.000235688, 0.0233555, -0.000213489, 1, -0.000952994, -0.0233557, 0.000947748, 0.999727, 0.000123931, 1.17911, 0.0012609)
transform = Transform3D(1, -2.64883e-15, 3.42285e-08, -2.53587e-15, 1, 1.51473e-07, -3.42285e-08, -1.51473e-07, 1, -2.06898e-15, 1.21587, -1.57713e-07)
[node name="AnimationTree" type="AnimationTree" parent="." index="4"]
tree_root = SubResource("AnimationNodeStateMachine_7v7qh")
anim_player = NodePath("../AnimationPlayer")
parameters/current_length = 1.04167
parameters/current_position = 0.555226
parameters/current_delta = 0.1
parameters/current_length = 0.0
parameters/current_position = 0.0
parameters/current_delta = 0.0
parameters/conditions/grounded = false
parameters/conditions/jumping = false
parameters/Death_A/current_length = 0.791667
@ -277,23 +190,23 @@ parameters/End/current_length = 0.0
parameters/End/current_position = 0.0
parameters/End/current_delta = 0.0
parameters/IWR/current_length = 1.04167
parameters/IWR/current_position = 0.555226
parameters/IWR/current_delta = 0.1
parameters/IWR/blend_position = Vector2(0.000524879, 0.00335574)
parameters/IWR/current_position = 1.04167
parameters/IWR/current_delta = 0.0
parameters/IWR/blend_position = Vector2(0.0362204, 0.863281)
parameters/IWR/0/current_length = 1.04167
parameters/IWR/0/current_position = 0.555226
parameters/IWR/0/current_delta = 0.1
parameters/IWR/0/current_position = 0.765353
parameters/IWR/0/current_delta = 0.0166667
parameters/IWR/1/current_length = 0.791667
parameters/IWR/1/current_position = 0.791667
parameters/IWR/1/current_delta = 0.0
parameters/IWR/2/current_length = 1.06667
parameters/IWR/2/current_position = 0.408754
parameters/IWR/2/current_delta = 0.0166667
parameters/IWR/2/current_length = 1.04167
parameters/IWR/2/current_position = 1.04167
parameters/IWR/2/current_delta = 0.0
parameters/IWR/3/current_length = 0.791667
parameters/IWR/3/current_position = 0.791667
parameters/IWR/3/current_delta = 0.0
parameters/IWR/4/current_length = 0.8
parameters/IWR/4/current_position = 0.61058
parameters/IWR/4/current_length = 0.791667
parameters/IWR/4/current_position = 0.390352
parameters/IWR/4/current_delta = 0.0166667
parameters/Jump_Idle/current_length = 1.04167
parameters/Jump_Idle/current_position = 0.0352051
@ -320,4 +233,4 @@ parameters/Unarmed_Melee_Attack_Punch_B/current_length = 1.66667
parameters/Unarmed_Melee_Attack_Punch_B/current_position = 1.66667
parameters/Unarmed_Melee_Attack_Punch_B/current_delta = 0.01703
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_computed"]
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_velocity_computed"]

@ -17,17 +17,14 @@ var map_ready := false
@onready var anim_state = $AnimationTree.get("parameters/playback")
@onready var nav_agent: NavigationAgent3D = $NavigationAgent3D
func _ready() -> void:
func _physics_process(delta: float) -> void:
set_movement_target(nearest_player.position)
func _physics_process(delta: float) -> void:
if !map_ready:
return
if nav_agent.is_navigation_finished():
return
var next_path_position: Vector3 = nav_agent.get_next_path_position()
model.look_at(next_path_position)
var new_velocity: Vector3 = global_position.direction_to(next_path_position) * speed
if nav_agent.avoidance_enabled:
nav_agent.set_velocity(new_velocity)
@ -36,11 +33,12 @@ func _physics_process(delta: float) -> void:
func _on_velocity_computed(safe_velocity: Vector3):
velocity = safe_velocity
var vy = velocity.y
velocity.y = 0
var vl = velocity * model.transform.basis
anim_tree.set("parameters/IWR/blend_position", Vector2(vl.x, -vl.z) / speed)
velocity.y = vy
move_and_slide()
func set_movement_target(movement_target: Vector3):
nav_agent.set_target_position(movement_target)
func _on_navigation_region_3d_bake_finished() -> void:
map_ready = true
print("NavigationRegion3D Map ready...")