This commit is contained in:
maxwes08
2025-09-09 10:57:28 +02:00
parent 3678eaa5f8
commit b6655d71d9
6 changed files with 148 additions and 81 deletions

View File

@@ -20,11 +20,9 @@ namespace Voxel
public void BreakBlock()
{
var (hit, x, y, z) = _world.Raycast(5f); // max 5 blocks
if (hit != Blocks.Air)
{
_world.SetBlock(x, y, z, Blocks.Air);
}
var (success, hit, x, y, z) = _world.Raycast(Camera.Position, Camera.Front * 10, 100);
if (!success) return;
_world.SetBlock(x, y, z, Blocks.Air);
}
public void Update(float deltaTime)