From d9d5b7b5c58a7b044b78ee7993f0a15e5b79f689 Mon Sep 17 00:00:00 2001
From: miepzerino <o.skotnik@gmail.com>
Date: Thu, 03 Apr 2025 18:28:15 +0000
Subject: [PATCH] #42 started performance fixes for chunk generation
---
Assets/Scripts/Managers/GameManager.cs | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/Assets/Scripts/Managers/GameManager.cs b/Assets/Scripts/Managers/GameManager.cs
index 524a68a..9f4d5ed 100644
--- a/Assets/Scripts/Managers/GameManager.cs
+++ b/Assets/Scripts/Managers/GameManager.cs
@@ -144,7 +144,10 @@
cellCoord.x = cellCoord.x + 1;
break;
case DrillDirection.Down:
- cellCoord.y = cellCoord.y - 1;
+ // Use player's center position for downward drilling
+ Vector3 playerCenter = contact.rigidbody.transform.position;
+ cellCoord = grid.WorldToCell(playerCenter);
+ cellCoord.y = grid.WorldToCell(contact.point).y - 1; // Keep the vertical position from contact point
break;
}
--
Gitblit v1.10.0