fix: restrict 0.08 tile elevation exclusively to Stop n Go and Freemode
This commit is contained in:
+7
-9
@@ -192,17 +192,15 @@ func _hide_ground_tiles():
|
|||||||
func _setup_effect_elevation():
|
func _setup_effect_elevation():
|
||||||
var em = get_node_or_null("EnhancedGridMap")
|
var em = get_node_or_null("EnhancedGridMap")
|
||||||
if em and em.mesh_library:
|
if em and em.mesh_library:
|
||||||
# The arena is shifted down by -0.22, putting the physical 3D floor around Y=0.06.
|
|
||||||
# To prevent gridmap tiles from clipping or being buried under the terrain,
|
|
||||||
# we apply a universal Y-lift to all items in the mesh library so they render slightly above the grass.
|
|
||||||
var ml = em.mesh_library.duplicate()
|
var ml = em.mesh_library.duplicate()
|
||||||
var lift_transform = Transform3D().translated(Vector3(0, 0.08, 0))
|
|
||||||
|
|
||||||
for id in ml.get_item_list():
|
# Only lift tiles for modes that use the shifted Terrainv2.gltf (-0.22 offset)
|
||||||
# Skip non-walkable blocks since we hide them anyway
|
if LobbyManager.game_mode in ["Stop n Go", "Freemode"]:
|
||||||
if id == 4: continue
|
var lift_transform = Transform3D().translated(Vector3(0, 0.08, 0))
|
||||||
var current_transform = ml.get_item_mesh_transform(id)
|
for id in ml.get_item_list():
|
||||||
ml.set_item_mesh_transform(id, lift_transform * current_transform)
|
if id == 4: continue # Skip hidden non-walkable blocks
|
||||||
|
var current_transform = ml.get_item_mesh_transform(id)
|
||||||
|
ml.set_item_mesh_transform(id, lift_transform * current_transform)
|
||||||
|
|
||||||
em.mesh_library = ml
|
em.mesh_library = ml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user