- Home /
Voxel engine physics
Hello all,
I'm new to unity and currently building a voxel engine. I now have a chunk that has a mesh. My question is: Is it efficient to turn on built in physics stuff of unity on on the chunk mesh (keep in mind there will be a lot of chunks in the future). Or is it better to write my own collision logic for the objects that have to collide with the blocks.
Answer by Bunny83 · May 15, 2013 at 07:12 PM
Well it depends. Unity's physics system is not that bad, however having lots of colliders might have an impact on performance. I wouldn't use MeshColliders since they are, well, not that cooperative when it comes to updating the mesh. I would use primitive colliders (mainly BoxColliders). However only use a few and reuse them.
The great thing on a gird-world is you can always simply round the player position to get the grid coordinates. Now you just need to update the colliders "around" the player.
It's just one approach. Implementing your own collision detection is not that easy, you'll see what i mean when you try it ;)
Thanks for your quick response :) Can you give resources or examples on how to reuse colliders in this situation?
Your answer
Follow this Question
Related Questions
Voxel spaceship collider 1 Answer
No collision detection with back faces in voxel game. HELP! 1 Answer
Voxel engine physics 3rd person character controller 1 Answer
Keep Horizontal Momentum after Jump 2 Answers
How to stop sphere from clipping through cube edges aside from lowering Time.FixedDeltaTime? 1 Answer