Hello all… I’m wondering what the best (ie. most processing-efficient) method is for estimating collision with a the interior (concave) side of a curved surface – think the inside of a pipe, or a waterslide, or bobsled track. Think of a car or ball/marble that would need to slide down this surface…
Since there are (unfortunately) no cylinder primitives in Unity, I was wondering which of the following would be ideal:
- Create the pipe/track and use mesh colliders (I am going to automatically assume this is the worst option)
- Use the mesh for visual, but estimate the curves using a series of angled box colliders (say, 6 to represent a semi-circular curve, or 12 for all the way around the cylinder… I imagine this is efficient, but where it gets difficult is when there are bends/curves in the pipe/track)
- Use the regular mesh for visual, but a simplified cylinder mesh for collider…
- A combination of the above? (box colliders for straightaways, low-poly meshes for bends/curves; this may be what I have to do…)
PS. On a related note, which of these would likely be more resource-intensive: a series of meshes (like modular segments) combined into one whole mesh (of, say, a winding pipe or track) and using a single mesh collider for this complex mesh, or using each segment as an individual mesh with individual mesh colliders? (in which case you would have a lot of objects, but each one would be a lot easier to calculate – I imagine this still might be faster, but I don’t know if one complex mesh or multiple simple meshes is better… I assume multiple simple meshes)
P.P.S. It would be really nice if there were a modular cylinders/pipes asset in the asset store to be used for this purpose (tracks/tunnels), but I don’t see one. If I can get these assets made, maybe I will put them up for sale, because I know other people have wanted the same thing… [if anybody knows of one, please inform me, I’d rather not take the time creating it, even though it’s relatively simple…]