public override void _PhysicsProcess(float delta) { if (_currentlyPlacingBuilding == null) { return; } var spaceState = GetWorld().DirectSpaceState; var intersection = spaceState.IntersectRay( _cameraController.GetPickingRayPosition(), _cameraController.GetPickingRayEnd(50), null, 1 << 4); if (intersection.Count > 0) { var localPosition = (Vector3)intersection["position"] - GlobalTransform.origin; _currentlyPlacingBuilding.MoveTo(new Vector3(Mathf.Floor(localPosition.x), 0.0f, Mathf.Floor(localPosition.z))); } }
public void MoveTo(IPosition pos) => Building.MoveTo(pos);