I am quite new to unity and i have no idea about scripting i was hoping if anyone would be kind enough to write me a few scripts. Scripts which would allow me to control a car that i have made. I have tried using the car tutorial scripts but for some reason they wouldn't work, if anyone could help me with this i would be most thankful.
4 Answers
4Unity3D websites own car tutorial. You can find a lot of tutorials if you just search on google.
That Unity Car Tutorial will not work on your car if you just add the script to your car... simple because there are so many things they have added and you have to add all to your car too .. the idea is to give you how you can also build a complex car like that.. by studying that script and picking up the ideas... if you are new start with the basic movement for your car and little by little study that script to add more features to your car..
var leftWheel: WheelCollider;
var rightWheel: WheelCollider;
var maxTorque= 5.0;
var CenterOfMass : Transform;
function Start () {
//rigidbody.CenterOfMass.y = 0;
GetComponent.().CenterOfMass= CenterOfMass.localposition;
}
function FixedUpdate () {
leftWheel.motorTorque= maxTorque* Input.GetAxis(“Vertical”);
rightWheel.motorTorque= maxTorque* Input.GetAxis(“Vertical”);
leftWheel.steerAngle= 10* Input.GetAxis(“Horizontal”);
rightWheel.steerAngle= 10* Input.GetAxis(“Horizontal”);
}
The car tutorial doesn't work?
– StatementAt what point does it fail?
– Mythits the scripts when i add them to my car they dont do anything
– anon93657468This might seem a silly question to ask but: Have you read the pdfs? I certainly haven't tried that tutorial but maybe you haven't paid attention about how to use the scripts, and what other components might be required?
– Statementi have read through most of the pdfs but they dont make much sense to me.
– anon93657468