public void PaintAtHoverPosition() { //Get GameObject that we hovered over to check if we can paint, //also use its rotation for the new tile. GameObject hoveredTile = VMEGlobal.GetTileAtMousePosition(); //if theres none. if (hoveredTile == null) { Debug.LogWarning("[Paint Mode]: Not hovered over a tile, thereby can't paint a tile."); } else { //Get selected item in Swatch. GameObject selectedSwatchItem = voxelSwatchReference.GetSelectedTile(); //Get position next to hovered tile. Vector3 newPosition = VMEGlobal.GetPositionNextToHoveredTile(); //Paint the tile. VMEMainWindow.Instance.tileAddControls.PaintTIle(selectedSwatchItem, hoveredTile, newPosition); } }