Hello, how can I non-uniformly scale MeshCollider in Unity ECS Physics? I was following Physics samples nr. 9. - Modify/Modify - Runtime Collider/Modify and the only relevant code I found is the one below:
float3 oldSize = 1.0f;
float3 newSize = 1.0f;
unsafe
{
// grab the box pointer
BoxCollider* bxPtr = (BoxCollider*)collider.ColliderPtr;
oldSize = bxPtr->Size;
newSize = math.lerp(oldSize, size.Target, 0.05f);
// if we have reached the target size, get a new target
float3 newTargetSize = math.select(size.Min, size.Max, size.Target == size.Min);
size.Target = math.select(size.Target, newTargetSize, math.abs(newSize - size.Target) < new float3(0.1f));
var boxGeometry = bxPtr->Geometry;
boxGeometry.Size = newSize;
bxPtr->Geometry = boxGeometry;
}
Problem is that this code non-uniformly scales BoxCollider, whereas I would need to scale MeshCollider, which doesn’t have Size property. Is there a way to achieve this?
Thanks in advance for your answers!