fix: adjust safe zone elevation and transparency sorting priority to prevent it covering tiles or clipping with terrain

This commit is contained in:
2026-07-06 17:42:26 +08:00
parent b879c7b684
commit f1ef43cb38
2 changed files with 11 additions and 1 deletions
+9 -1
View File
@@ -199,8 +199,16 @@ func _setup_effect_elevation():
var lift_transform = Transform3D().translated(Vector3(0, 0.08, 0))
for id in ml.get_item_list():
if id == 4: continue # Skip hidden non-walkable blocks
var apply_transform = lift_transform
# TILE_SAFE (2) is painted on Layer 2 (Y=0.10).
# We want it below all grid tiles (Layer 0 is at 0.08) but above the terrain (0.06).
# We set it to 0.07 by applying a -0.03 offset (0.10 - 0.03 = 0.07).
if id == 2:
apply_transform = Transform3D().translated(Vector3(0, -0.03, 0))
var current_transform = ml.get_item_mesh_transform(id)
ml.set_item_mesh_transform(id, lift_transform * current_transform)
ml.set_item_mesh_transform(id, apply_transform * current_transform)
em.mesh_library = ml