From 84bb8cbec9dd17fd86885f378208ebfec96a3f77 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Sun, 22 Sep 2024 19:57:04 +0100 Subject: bsp_level_generator: Fix navmesh generation Make it so doors generate properly in the navigation mesh --- scripts/bsp_level_generator.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/bsp_level_generator.gd') diff --git a/scripts/bsp_level_generator.gd b/scripts/bsp_level_generator.gd index 2243481..ac095ef 100644 --- a/scripts/bsp_level_generator.gd +++ b/scripts/bsp_level_generator.gd @@ -7,7 +7,7 @@ extends Node3D @export_category("Geometry Generator") ## Geometry generation config -@export var wall_thickness: float = 1.25 +@export var wall_thickness: float = 1.3 @onready var mesh: MeshInstance3D = $MeshInstance3D @@ -140,6 +140,7 @@ func generate_geo(grid: Array[Tile], array: Array): generate_plane(array, Vector3(x, 2, y+1), [Vector3(1, 0, 0), Vector3(0, -2, 0)], Vector3.BACK) generate_plane(array, Vector3(x+1, 2, y+1), [Vector3(0, 0, -1), Vector3(0, -2, 0)], Vector3.LEFT) generate_plane(array, Vector3(x+1, 2, y), [Vector3(-1, 0, 0), Vector3(0, -2, 0)], Vector3.FORWARD) + pass func _ready() -> void: var starting_axis = randi_range(0, 1) @@ -164,3 +165,5 @@ func _ready() -> void: var tri_mesh = mesh.mesh.create_trimesh_shape() $NavigationRegion3D/StaticBody3D/CollisionShape3D.shape = tri_mesh $NavigationRegion3D.bake_navigation_mesh() + + #ResourceSaver.save(mesh.mesh, "res://map.tres", ResourceSaver.FLAG_COMPRESS) -- cgit