check limit matter collider size
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user