diff options
author | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2024-09-22 15:33:22 +0100 |
---|---|---|
committer | Lucas Fryzek <lucas.fryzek@fryzekconcepts.com> | 2024-09-22 15:33:22 +0100 |
commit | e9b2e264f767da4e630a515ae3217f3966be9ce6 (patch) | |
tree | 3f7517104ed7061eb9be9e9d70b9abefa10cac80 /prefabs | |
parent | 5f6ba92130f55ec81f2336d488743c6ff2aeaf74 (diff) |
bsp_level_generator: Create navigation mesh
Also make enemy AI use nav mesh for finding player
Diffstat (limited to 'prefabs')
-rw-r--r-- | prefabs/bsp_level_generator.tscn | 7 | ||||
-rw-r--r-- | prefabs/enemy.tscn | 2 | ||||
-rw-r--r-- | prefabs/test_arena.tscn | 1 |
3 files changed, 8 insertions, 2 deletions
diff --git a/prefabs/bsp_level_generator.tscn b/prefabs/bsp_level_generator.tscn index dbb62a5..ea0cfd7 100644 --- a/prefabs/bsp_level_generator.tscn +++ b/prefabs/bsp_level_generator.tscn @@ -1,6 +1,11 @@ -[gd_scene load_steps=2 format=3 uid="uid://w7hxcvuvud"] +[gd_scene load_steps=3 format=3 uid="uid://w7hxcvuvud"] [ext_resource type="Script" path="res://scripts/bsp_level_generator.gd" id="1_6jn1x"] +[sub_resource type="NavigationMesh" id="NavigationMesh_q1fo6"] + [node name="BspLevelGenerator" type="Node3D"] script = ExtResource("1_6jn1x") + +[node name="NavigationRegion3D" type="NavigationRegion3D" parent="."] +navigation_mesh = SubResource("NavigationMesh_q1fo6") diff --git a/prefabs/enemy.tscn b/prefabs/enemy.tscn index 9ed692e..71e35f8 100644 --- a/prefabs/enemy.tscn +++ b/prefabs/enemy.tscn @@ -26,4 +26,6 @@ shape = SubResource("CapsuleShape3D_s5qw4") [node name="HitTimer" type="Timer" parent="."] wait_time = 0.2 +[node name="NavigationAgent3D" type="NavigationAgent3D" parent="."] + [connection signal="timeout" from="HitTimer" to="." method="_on_hit_timer_timeout"] diff --git a/prefabs/test_arena.tscn b/prefabs/test_arena.tscn index 81bd235..7bdeba8 100644 --- a/prefabs/test_arena.tscn +++ b/prefabs/test_arena.tscn @@ -113,6 +113,5 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 20, 0, 20) collision_layer = 5 motion_mode = 0 target = NodePath("../Player") -gravity_enabled = true [node name="BspLevelGenerator" parent="." instance=ExtResource("4_501hd")] |