What does "Not allowed to call RecalculateBounds() on..." mean?

I’m calling RecalculateBounds() after swapping out the materials array. On certain meshes, I get the error “Not allowed to call RecalculateBounds() on mesh [mesh name]”. In standalone builds, this crashes (in math.h SwizzleColorForPlatform, eventually).

What are the properties of these meshes that disallow RecalculateBounds? Is there an alternative? Is there a way to detect this so I can bypass this code path for those meshes?


Got it! The object was set to “Static”, so of course it’s not permissible to alter it at runtime. It would be nice if that were in the error message, or if attempting to do so didn’t cause a crash. But there you have it.