Hello all,
I am building an infinite highway that has a lot of vehicles to simulate infinite heavy traffic. Its about 40 vehicles in a pool that are cycled from back-to-front or visa versa. In my initial prototype I just made the traffic vehicles simple rigidbody box colliders sliding across the highway’s surface collider. This seems to be working well and smooth, but there are some issues such as some vehicles randomly getting stuck on the seams between highway pieces that you can’t see visually, but the physics engine can. I’ve found some workarounds, like creating a step down, or a bridge, or making the vehicles hover, or rotate the vehicle front end up when it gets to the steams, or use a mesh collider and create a sled type front end, etc., but I am not entirely happy with any of those.
I believe wheel colliders would solve the problem, and make some other parts of my code cleaner regarding steering and vehicle AI. But, I don’t know exactly what goes on under the hood, so I was curious, would I get any performance gains or losses if I make the jump to wheel colliders? I guess I can spend some time and just test it myself, but I was wondering what the community would say?
I am guessing adding 4 different wheel collision checks to 40 vehicles would increase time complexity, but does it simplify physics of sliding a box over a surface? What do you think?