- Home /
Scaling a group of meshes framerate drops with 75%
I have a scene where I have grouped a small number of meshes by using an empty game object. On the empty game object I am applying a scale using the iTween library, method ScaleAdd. Frame rate drops with 75%. When I do the same using rotate or move the frame rate doesn't change a lot. The meshes all use the same material and have a rigidbody and mesh collider attached. I have checked performance by changing shaders, materials, turning off lights etc.
To show you what I mean I have uploaded a screen cast. Hopefully, someone can explain why this is happening.
Here is the cast:Screen cast
I've found that scaling objects sometimes forces unity to re submit VBOs (vertex buffer objects) to the GPU. This is slow and should be avoided. I'm unsure why it only sometimes happens though. I've had it happen to me and all I did to fix it was delete and reconstruct the object to be identical as it was before and the problem disappeared... not the best solution.
Answer by Paulius-Liekis · Jun 07, 2011 at 08:35 AM
You should try Profiler view in Unity - it would pin point the problem immediately.
Problem in your case is that you have a collider and you want to scale your object. Physics can't have scaled colliders, so when you scale it physics has to apply scale on the collider. That's what's taking most of the time. You have to either not use collider on your scaled object or not use scale.
That's it! I removed the mesh colliders and guess what, the performance did not drop AT ALL! Ins$$anonymous$$d it even got a little better even when I rotated and scaled the group of meshes at the same time. So the conclusion is indeed that scaling meshes with collider components attached are absolutely $$anonymous$$ILLING the performance!
Thanks for the quick answer!
Your answer
Follow this Question
Related Questions
Input.location.start always times out 1 Answer
Unity 5.0.1f1: iOS client to Linux server RPC silent failure 1 Answer
LocalNotifications deprecated in Unity 5 2 Answers
My iPhone Builds with Unity 5.1 and up on iPhone 4 and 5c are having issues 0 Answers
WWW not working to load image on iOS from google static maps. 0 Answers