Jump to content

[SOLVED] The way to create static collider for best performance


Recommended Posts

Posted

I want to create a static collider — for example, a fence. I believe there are two ways to do this:

  1. Enable the collision flag for all surfaces of the mesh, or

  2. Add a dummy body to the mesh that uses a collision shape with simpler geometry.

Which method offers better performance?
Thanks!

 

Posted

Hey there!

@donaltrungThe second option should be way faster, so it’s probably the best fit for your case :)

Thanks!

Posted

So it doesn't matter whether we use Shape–Shape or Shape–Surface collisions — more complex geometry always reduces performance, right?

Posted
2 hours ago, donaltrung said:

So it doesn't matter whether we use Shape–Shape or Shape–Surface collisions — more complex geometry always reduces performance, right?

Shape-to-Shape collisions are extremely fast (e.g., cube vs cube or cube vs sphere) since there are no triangles involved in the computation.

Shape-to-Surface collisions will always be slower, as the shape needs to be checked against all the triangles on the surface.

Thanks!

Posted
Just now, donaltrung said:

OK! Thanks!

You're welcome!

  • bmyagkov changed the title to [SOLVED] The way to create static collider for best performance
×
×
  • Create New...