- Home /
Collisions... without colliders? :P
Hey guys, I'm working on a game currently that generates a procedural mesh, this means that hundreds of mesh colliders need to be added to every mesh. This results in large lag spikes, especially on the iPhone. If I disable the mesh colliders from the spawning script, there is zero lag and the world generates perfectly! (minus the player falling through the ground). I was wondering if there was a way I could detect the collision between the player and the world mesh without using colliders? Any help is appreciated thanks!
What do you mean 'hundereds of mesh colliders need to be added to every mesh'? Only one mesh collider per mesh should be possible. Unless you put them in separate GameObjects. What is the 'world mesh'?
Sorry let me elaborate, The world is seperated into seperate "chunks" which are meshes, The map is generated out of a lot of chunks to make a segment of the map, when you reach the edge of this segment another segment is generated therefore more chunks are generated therefore a lot of mesh colliders are needed.
Answer by IgorAherne · Jul 21, 2013 at 08:15 AM
Hm, did you try occlusion culling?
Ohhh the problem isn't the amount of mesh colliders in the scene, it's that 100's of mesh colliders are being generated at once.
Answer by jordantotty · Jul 21, 2013 at 10:53 AM
Ohhhh, the problem isn't the amount of mesh colliders in the scene, the lag is from 100's of mesh colliders being generated at once. :)
Answer by Chiroculon · Apr 06, 2017 at 10:04 PM
@jordantotty Since you only want to check for collisions between the player and the world, you could start by only creating the colliders close to the player and add the others as needed.
Also, consider using simpler colliders.
Your answer
![](https://koobas.hobune.stream/wayback/20220613110533im_/https://answers.unity.com/themes/thub/images/avi.jpg)