feat: npc follow logic

This commit is contained in:
Sara Gerretsen 2026-01-18 23:26:41 +01:00
parent 411f1662c1
commit 1e94542085
14 changed files with 268 additions and 11 deletions

View file

@ -1,6 +1,7 @@
[gd_scene format=3 uid="uid://cv0ub3llm3jew"]
[ext_resource type="PackedScene" uid="uid://dcqd0wo5y5a1g" path="res://objects/player_character.tscn" id="1_kyfjp"]
[ext_resource type="PackedScene" uid="uid://dfbdn64i7vfuc" path="res://objects/party_member.tscn" id="2_amxg5"]
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_kyfjp"]
sky_horizon_color = Color(0.66224277, 0.6717428, 0.6867428, 1)
@ -15,6 +16,10 @@ sky = SubResource("Sky_amxg5")
tonemap_mode = 2
glow_enabled = true
[sub_resource type="NavigationMesh" id="NavigationMesh_amxg5"]
vertices = PackedVector3Array(-8.5, 0.5, -9, -6.5, 0.5, -9, -6.5, 0.5, -49.5, -49.5, 0.5, -7.5, -8.75, 0.5, -7.25, -49.5, 0.5, -49.5, -4.25, 0.5, -9, -4.25, 0.5, -49.5, -2, 0.5, -8.75, 49.5, 0.5, -6.5, 49.5, 0.5, -49.5, -2, 0.5, -6.5, -7.75, 2.5, -8, -7.75, 2.5, -5.25, -3, 2.5, -5.25, -3, 2.5, -8, -49.5, 0.5, -5.75, -8.75, 0.5, -6, -2, 0.5, -4.5, -3.75, 0.5, -4.25, -3.5, 0.5, 49.5, 49.5, 0.5, 49.5, -8.75, 0.5, -4.5, -7, 0.5, -4.25, -49.5, 0.5, 49.5, -7.25, 0.5, 49.5)
polygons = [PackedInt32Array(2, 1, 0), PackedInt32Array(4, 3, 0), PackedInt32Array(0, 3, 5), PackedInt32Array(0, 5, 2), PackedInt32Array(2, 7, 1), PackedInt32Array(1, 7, 6), PackedInt32Array(6, 7, 8), PackedInt32Array(8, 7, 10), PackedInt32Array(8, 10, 9), PackedInt32Array(9, 11, 8), PackedInt32Array(15, 14, 12), PackedInt32Array(12, 14, 13), PackedInt32Array(17, 16, 4), PackedInt32Array(4, 16, 3), PackedInt32Array(18, 11, 9), PackedInt32Array(18, 9, 19), PackedInt32Array(19, 9, 20), PackedInt32Array(20, 9, 21), PackedInt32Array(16, 17, 22), PackedInt32Array(22, 23, 16), PackedInt32Array(16, 23, 25), PackedInt32Array(16, 25, 24), PackedInt32Array(23, 19, 25), PackedInt32Array(25, 19, 20)]
[node name="TestWorld" type="Node3D" unique_id=262419127]
[node name="WorldEnvironment" type="WorldEnvironment" parent="." unique_id=1185961481]
@ -27,13 +32,19 @@ shadow_enabled = true
[node name="PlayerCharacter" parent="." unique_id=1435471129 instance=ExtResource("1_kyfjp")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="." unique_id=885387983]
[node name="PartyMember" parent="." unique_id=2124931928 instance=ExtResource("2_amxg5")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2, 1, 5)
[node name="NavigationRegion3D" type="NavigationRegion3D" parent="." unique_id=357996274]
navigation_mesh = SubResource("NavigationMesh_amxg5")
[node name="CSGCombiner3D" type="CSGCombiner3D" parent="NavigationRegion3D" unique_id=885387983]
use_collision = true
[node name="CSGBox3D" type="CSGBox3D" parent="CSGCombiner3D" unique_id=1853081325]
[node name="CSGBox3D" type="CSGBox3D" parent="NavigationRegion3D/CSGCombiner3D" unique_id=1853081325]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
size = Vector3(100, 1, 100)
[node name="CSGBox3D2" type="CSGBox3D" parent="CSGCombiner3D" unique_id=40055740]
[node name="CSGBox3D2" type="CSGBox3D" parent="NavigationRegion3D/CSGCombiner3D" unique_id=40055740]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -5.293318, 1.1054688, -6.6544046)
size = Vector3(5.5302734, 2.2109375, 3.6298828)