diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index e8905c9..c1dff2c 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -542,14 +542,15 @@ func _try_load_tile_bottom(body_ref: Variant, url: String) -> void: # the internal _model_local_aabb call returns a valid AABB. _fit_model_to_tile(bottom_node, 0.98) - # After fitting: AABB bottom (spike tip) is at body-local Y=0, - # AABB top (wide base) is at body-local Y = scaled_h. - # We want the wide base flush with the tile underside (body-local Y=-tile_h/2). - # Shift = -(tile_h/2 + scaled_h). + # After _fit_model_to_tile: the model's AABB bottom (spike tip) is at + # body-local Y=0 and the AABB top (wide base) is at body-local Y = scaled_h. + # The affinity model's visual base sits at body-local Y=0 (tile centre, + # world Y = tile_h/2), so we want the stalagmite base there too. + # Shift down by exactly scaled_h to bring the AABB top to body-local Y=0. var btm_aabb := _model_local_aabb(bottom_node) if btm_aabb.size != Vector3.ZERO: var scaled_h := bottom_node.scale.y * btm_aabb.size.y - bottom_node.position.y -= tile_h * 0.5 + scaled_h + bottom_node.position.y -= scaled_h )