- Home /
Whats the correct way of animating vehicles?
I want some cars and busses to populate my roads, they are NOT driven my a player, just decoration... NPC cars if you like. Im finding it hard to animate the transform of the vehicles, without them going through geometry or flaying. My scene is counrt roads, not flat cities.
I tried adding the wheel collidors, but that just means that my vehicles just run down the hill, fun.. but not what I want.
What would be the best way to do this? I would like to edit only the direction transforms, but let physics do the pulling down onto the ground. How can I achieve this?
Mark
it's incredibly difficult, and there are many approaches.
it vastly depends on what you want, how many there are, and how closely you will be seeing these NPC ("non player Cars !")
think about any race game you've ever played. Actually, the robot opponent cars are .. exactly what you describe right? So that's one approach.
if you actually need to see them "work properly" (suspension, turning wheels etc etc) then they have to be full car rigs with robot drivers.
If they can just be "smaller cars in the distance" then use car models, and have them follow paths you create.
or, some difficult combo in the middle !
Thanks for the response Fattie!
I dont really need very advanced, no. Its just a cut scene, the bus turns up outside the lonely building and leaves our protagonist etc...
I may want the wheels to turn (but then Ill just attach some anim clip) doesnt have to be perfect, no suspension needed as we are not "on board".
But as my ground is a little "bumpy" (those country roads you know) I dont(can't) animate every little incline or hill. So I was hoping to just add a rigid body and make it fall to the terrain layer (or the road really) and then animate ONLY the forward motion and turns. But the bus is just nose-diving thru the mesh and falling.
Any suggestions? Paths? This sounds interesting.. Is that a "thing"? Can an object orient itself to a "path", cos that would be fab!
$$anonymous$$ark
There isn't really a "correct" way. Some ways are just better than others. Is your vehicle rigged ?
Is your vehicle rigged ?
Hmm.. I dont really know what that means in regards to vehicles, so.. no.. I tried just chucking the wheel collidors on to see if I could stop it t´from falling thru geometry, but then it ran down the hill.
I think if I can get it to follow X and Z but allow gravity to do the Y, I will be happy...
but how?
Your answer
![](https://koobas.hobune.stream/wayback/20220613083052im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Rear wheels move to the center of the car object in car tutorial 1 Answer
How to translate car wheels to suspension? 1 Answer
Vehicles owned by Server being controlled by other NetworkPlayers in a network game 1 Answer
Increasing vehicle realism when turning 1 Answer
is there a good ai car tutorial about 2 Answers