check limit matter collider size

This commit is contained in:
NguyenVanDat
2026-04-20 09:45:40 +07:00
parent ef0ee9a6dc
commit 47f16af3f6
@@ -178,9 +178,9 @@ namespace PerfectWorld.Scripts
//this is a workaround to fix the collider size issue when load prefab go wrong at some point
//TODO: remove this workaround after the prefab load issue is fixed
Vector3 size = matterObject.GetComponentInChildren<Renderer>().bounds.size;
if (size.x == 0) size.x = 0.5f;
if (size.y == 0) size.y = 0.5f;
if (size.z == 0) size.z = 0.5f;
if (size.x < 0.5f) size.x = 0.5f;
if (size.y < 0.5f) size.y = 0.5f;
if (size.z < 0.5f) size.z = 0.5f;
collider.size = size;
}
// Create text object to display item name above the cube