0

I have a large Game Object that has many children (20 - 30 objects) each with their own mesh collider. For some reason, about half of my children's colliders are being overridden by the parent's collider because they maybe slightly behind it at a certain angle. (i.e. Raycast on the car_door and it returns the car_frame parent object) At first I thought it would be as easy as inflating the mesh colliders, but I found out very quickly that will not work as it is very memory intensive. So my main concern is how would I combat this situation? Are there any workarounds to Inflate Mesh that are not so memory intensive?

I would like to stay away from creating individual box colliders and such just based on the sheer number of objects I am dealing with. I would really like the solution to be scalable.

Dtb49
  • 1,211
  • 2
  • 19
  • 48
  • A screenshot of your mesh (in wireframe) would be helpful. Particularly of the door and frame discussed in your question, so we could assess if there is something more fundamental that could be done. Inflating the mesh is not likely the solution you want. – Fuzzy Logic Feb 26 '18 at 21:18
  • I may have found a solution @FuzzyLogic , I'm not sure how it affects memory, but if I uncheck the convex variable for the mesh collider on the parent object it doesn't create a collider over the holes in the mesh. How does this affect memory? It seems a lot better than inflate mesh at least. – Dtb49 Feb 26 '18 at 21:33
  • That is a more appropriate solution. It shouldn't really affect memory much but a concave collision mesh will greatly affect performance of the collision detection, which is why it's a good idea to use box colliders as a precursory collision test before testing against the actual mesh. It's significantly faster to test against simple boxes (or other primitive colliders, even convex mesh) first. – Fuzzy Logic Feb 26 '18 at 21:48

1 Answers1

0

For my specific needs simply using a concave mesh collider seems to be the best option as of right now, (i.e. making sure that convex is not checked in the inspector) unless someone else comes along with a better solution. Luckily, I am not doing a lot of collision detection.

Dtb49
  • 1,211
  • 2
  • 19
  • 48