I’m working on a bowling-type game on terrain, and the ball keeps dropping through the level geometry. The level geometry has no thickness and has rolling terrain or whatever is on needed in a typical level. It’s a normal size in Unity, about 10-15 meters, and the ball is sized relative to the level. When I say ‘no thickness’, think of a flat plane that’s been modified to have hills, valleys, etc.
We’re noticing that the ball keeps dropping through the terrain at higher speeds when rolled, and perhaps this is a programming issue, but is there anything on the art side I can do to help this, or does this need to be addressed some other way?
I was asked about making the terrain ‘thicker’ or ‘denser’ for a thicker mesh collider. Does this make sense? How do the rest of you build your terrain?
Also, is there any reason to add extra mesh-density to help with collision rather than standard, efficient modeling to keep processor overhead low on mobile devices?
Thanks. Sorry about the obtuse nature of the query but I am just seeing what my options are on the art side to help with any of this.
Could the issue be that your ball is moving fast enough to pop all the way through your terrain in one frame’s worth of motion? If so, it’s unlikely to be a programming issue on your end. Check out continuous and/or dynamic collisions, because they’re what you need, but I’ve got a feeling they’re supported only between primitive colliders so you could be out of luck with a terrain involved.
Most people would build terrain using the built in terrain tools, which should be pretty well optimised for this kind of thing and might fix your problem on their own.
I don’t think that a higher-poly mesh is likely to help your issue, but as I’m not sure exactly how mesh colliders work I could be wrong there. It’s something you could pretty easily test and let everyone else know, though.
I have a little experience with this issue and the only viable solution for this issue is to slow it down or to duplicate the terrain and lower it maybe 0.001 on the Y axis. You can also try scaling up everything in the level to help prevent an ignore of colliders, or create a specific object (maybe out of cubes or even a unique mesh), and use convex mesh colliders. I’ve found that <www.turbosquid.com> has a lot of high-quality free meshes, so you may want to check that site out.
Again, I don’t have too much experience solving this issue, but for an smallish object with a rigidbody moving at high velocities, it is inevitable that it will pass through colliders at some point.