localScale speed

Setting transform.localScale to anything but 1 is absolutely bringing everything to a crawl. I have less than 200 scaled objects, and the framerate is absolutely unacceptable (goes from like 60fps to 3), even if the scaled objects have no colliders, and the scale value is only set once.

After looking around a bit, it seems I’m not the only one seeing this, and it’s a problem that has been around for some time, and I see no official response to complaints. Not only is this a massive engine limitation for people needing to scale a bunch of objects, no doubt this is unnecessarily slowing down a bunch of other people’s work that may be only scaling a few objects, and don’t realize that the innocuous seeming localScale is crippling them. I’d very much like to know if this is being fixed, or if there’s something I’m missing, because I find this quite disheartening.

Bump. Not being able to scale objects is a very serious issue.

Are you changing the scale value dynamically from a script, or is this happening when you set the scale from the inspector (or both)? Also, is this for desktop/web or iPhone?

So far happens any way I change scale, from script, inspector, or animation, and I’m using desktop version. Originally I thought it was just dynamic scaling, but it happens if I change the scale on a prefab once in inspector, and do nothing to the scale after that.

ive had a similar issue when scaling imported (FBX) models, and putting them in a prefab. For me, the problem was “funky” geometry, on the model that I had done in 3DS MAX.

I had a post, with a hole through it. The hole was made via a ProBoolean in 3DSMAX, and Unity did not like scaling this object for some reason. I went back into 3DSMAX and filled the hole. I must have used a wrong technique or something, because the FBX exporter did throw a warning. I dont know if this is the same as your problem, but if they are custom models, check for funky geometry

Running it through the profiler, without scaling the Camera.Render function takes about 25ms, and jumps to 130+ if I scale the prefab I’m instancing 160 times. The culprit is MeshRenderer.ComputeScaledMesh, which is called 160 times, and takes a total of 70ms, then SubmitVBO takes 40ms. The objects I’m using are not high polygon, but of course, if you’re doing element level processing on each instance of one per frame, practically everything becomes high polygon :).

I’d wager this is affecting alot of people, they just assume that they need to lower polygons, which by the looks of it would help, but the problem is not that their objects are high polygon (at least not as far as the hardware is concerned).

And Theformand, it doesn’t have a problem if I scale it at the import level, which makes sense, that happens before it goes to the renderer. Not sure if that’s what you meant, but you might have gotten better results because of what I mentioned, just a function of the object having less polygons after you changed it.