- Home /
Mesh Collider slow down the app
I have a simple straight road and put a mesh collider on it, and a car on this road. if I run it on iPad then it gives poor performance, app not running soomthly.
If I put box collider instead of mesh collider then its running smoothly and gives better performance on iPad.
How can I improve performance of app with the mesh collider, am I doing something wrong?
Your answers will be appriciable.
Thanks in advance!
Answer by Lockstep · Dec 09, 2012 at 01:48 AM
Mesh colliders are the most expensive colliders possible. The more polygons your mesh has the worse it is. The performance is also very critical for mobile devices. I guess the road just has too many polygons to work as collider on iPad.
In generall you should only use mesh colliders when you have to. In many cases it is sufficient to approximate the shape of your gameObject with a capsule/cube/sphere.
If you have to use a mesh collider is always worth considering to make an additional mesh. This new mesh has roughly the same shape as the mesh on the gameObject but is less detailed. That way you use less performace on the collisions but maintain the same behaviour compared to using the original mesh.
All in all I'd suggest to lay box colliders over the road like you did before.
@ Lockstep : thanks for your reply. but we can't put a box collider on every roads if road has some slope or zig-zag or on mountains etc, then what can I do to improve the performance on iPad.
The only thing else that comes to my $$anonymous$$d is to use a less complex mesh for the collider. Like I tried to descriped. Open the road mesh with your 3D model program and remove as many verts and edges as possible without changing the shape too much. Save it under a new name i.e. roadmesh_collider. Then use this mesh for the collider ins$$anonymous$$d of the visible road mesh.
Your answer
Follow this Question
Related Questions
Game Lagging in iOS 0 Answers
Profiler does not show objects when hooked to an iPad 1 Answer
Android Tablet vs iOS iPad performance difference 0 Answers
Performance woe - full log given 1 Answer
Game Slow Performance on iOS 11 iPhone 6 0 Answers