- Home /
colliders performance
What is the most efficient way to make a simple wall using colliders?
Create a mesh collider from a simple model (there are 6 triangles for this example).
Create several box colliders that describes the wall (3 for this example).
Actully the question is what is more efficient in Unity: to calculate one box collision or one squad (two triangles) collision?
ps. I understand the complex meshes should collide using simplified geometry or even box collider when no need to calculate the collision precisionly.
upd. In my case I mean "one vs many" collision scheme, not "many vs many". This means smth like I got a hero (one hero) and he should collide with walls.2.2.
nice question, tho to me the real question is "how to simply get good performance from colliders"
Answer by GesterX · May 25, 2011 at 11:21 AM
Box colliders are always better for performance as they use broad phase collision detection. Mesh colliders use narrow-phase collision detection which is significantly more computationally costly and in most case unnecessary.
So broad phase help to solve "many vs many" collisions faster, correct?
This case are you still correct when we say the only one object collides those "many"?
I mean in my case there is only one object that should collide with the wall. So if we virtually skip the broad phase, should the box collider be faster?
Your answer
Follow this Question
Related Questions
Optimizing colliders for a third person character action/action RPG game 1 Answer
Box collider vs Quad(mesh) collider 1 Answer
Does disabling colliders increase performance? 2 Answers
Javascript Detecting a prefab's child's collision 2 Answers
Collision between player and static object doesn't work as intended 0 Answers