- Home /
Ground Hugging Vehicle
Hey fellas, I'm fairly new to Unity(only about 3 weeks under my belt), so I am unsure how to proceed with ground hugging issues. I found some ray-casting items in the forum, though I can;t quite understand them. I have been able to make a great terrain, and upload a vehicle model that a friend sent me (works great with lots of parts) but I can;t seem to get it hug the ground. Its pretty weird to see it floating like it is, so I could use some advice on how to proceed. the model is top heavy as well, so certain degrees should tip it over, that said, I don;t know how exactly to go ahead with this. any advice would be helpful. Thank you very much. Ryan
EDIT:
Thanks for the answer, hj, but rereading my post, I guess I wasn't exactly clear. I have got it to stay on the ground, just not contour. Say its going up a 20 degree hill, its body will remain fixed at a 90 degree angle. The map I have is not a race track but a landscape full of maps and holes. as for the rigid body, unless I checked kinematic, the parts they were attached to would simply separate from the vehicle and fall through the scape. Having its rotation contour to the landscape is what I'm after. Perhaps I missed something in the rigid body statement?
EDIT:
the problem -- your model is way too naive.
You will need colliders that represent the "wheels", the "bumper bars" as well as the body, top part of the body and so on.
Enjoy rigging !!
Be aware it is very, very VERY VERY difficult to make a really really good vehicle.
Almost everyone just buys one of the two or three good vehicle rigs available in the app store. Enjoy!
For now ... You need more colliders !! basically "keep adding them until it works"
Hey man Thanks for the advice, I'll give her a go. But the vehicle I am working is more of a toy car than a road racer. It has camera and lighting fixed about a foot and a half above the main body as well as the axles having multiple factors going into their movement. I should also mention the top speed of this bugger will only be about 3-5 kilometers an hour. hardly enough to launch it in the air.
Hmm, it coul dbe:
(1) make sure all measureents are REAL WORLD. if it is a toy car 20 cm long, make sure the actual size is 0.20meters.
PhysX can ONLY WOR$$anonymous$$ with "actual real world sizes"
and point 2 !!
(2) make sure the masses are REAL WORLD. look in "rigidbody" and set the kilograms mass correctly
PhysX can ONLY WOR$$anonymous$$ with "actual real world masses"
I guess your problem could be that simple!
Otherwise just post your rig here !
PS even if it is just a toy car, it would have to have great colliders. Funnily enough I did a toy car rig once and it was harder than a real car! ¡¡€€#!! Hope it helps in some way
Answer by hijinxbassist · Jun 23, 2012 at 08:01 AM
You will want rigidbody physics(most realistic). They will react as you would expect a normal "real world" object to react. The only thing with that is making sure they dont overlap or touch(you will get very sporadic motions(more than slight jerkiness, more like car fly's in the air!).
As long as these rigidbodies do not overlap your vehicle will respond very naturally to the terrain. Add a rigidbody to the main section of the vehicle. Add another to the front(check to make sure they arent touching/overlapping) Set each of the rigidbodies masses to a respectable number(might wanna do some car/vehicle research here). Then play and have fun. Since it is top heavy..the front rigidbodies mass will be higher than the actual body. As long as they dont overlap, you will see a more realistic looking terrain hugging vehicle. It will now be calculated by the physX engine(which is why its there ;) ).
Let us know how it goes.
Jinx, since you are more experienced, you are probably assu$$anonymous$$g he has pretty good "real world like" colliders.
It is actually a real art form, like Haiku, putting colliders on stuff. If you have experience it's second nature but it is very tricky at first. It is quite possible the obkect just has totally lousy colliders.
Also ... I guess they just have the mass set all wrong, or the lengths !!
Your answer
Follow this Question
Related Questions
Vehicle (tank) for my character 1 Answer
Weapons on vehicle 1 Answer
Game with Multiple Vehcicles - 1 Player 1 Answer
How to turn of collision for the player 1 Answer
Boat movement, driving and animation 1 Answer