- Home /
Simplified vehicle physics for ambient traffic vehicles
I'm working on a city based racing game for iOS. I'm using Unity's wheel collider to setup the physics for racing vehicles (both player controlled and AI controlled). The performance is very bad if I put in too many vehicles( > 30). I need a vehicle physics setup which is very simplistic and lightweight. I found that wheel colliders were the main cause of slowdown since they are slower than ray-casts and having 30 vehicles means 120 wheel colliders being updated every frame.
Is there a simplified way of implementing vehicle physics(maybe without using wheel colliders) for showing many vehicles at once on mobile platforms?
Answer by gribbly · Aug 27, 2012 at 08:28 AM
Can you just lerp the vehicles from point to point? Use something like:
http://docs.unity3d.com/Documentation/ScriptReference/Mathf.MoveTowards.html
Otherwise it would be pretty easy to build a simple car physics using a single rigid body, and push it around using forces. Would need to know more about the behavior you need to say more.
O$$anonymous$$ I should have explained it more precisely. The vehicles should have wheels and move like vehicles. The turning should look like a vehicle's, not a big balloon. Lerping will make the vehicle look like a brick float around especially while turning. All I want is a simplified vehicle physics, for example I don't need wheelcollider parameters like suspension and friction parameters(asymptote, stiffness etc.). The AI on these vehicles also need to be very simple probably using triggers, not ray-casts.
Your answer
Follow this Question
Related Questions
raycasts and vehicle traffic 1 Answer
Truck-Trailer Hinge Joint 0 Answers
Anti-roll bar doesn't work 0 Answers
Is there any way to tell a wheel collider which way gravity is without Physics.Gravity? 2 Answers