- Home /
Car Movement Script
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.
Answer by Statement · Mar 13, 2011 at 09:02 PM
Unity3D websites own car tutorial. You can find a lot of tutorials if you just search on google.
its the scripts when i add them to my car they dont do anything
This 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?
i have read through most of the pdfs but they dont make much sense to me.
Answer by Jurasic Man · Mar 30, 2011 at 03:30 AM
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..
Answer by BeyMod · Sep 27, 2016 at 10:39 AM
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"); }
Your answer
Follow this Question
Related Questions
Vehicle/car/ Movement 0 Answers
Vehicle Script not turning left and right! 0 Answers
Car movement script ? 1 Answer
Issue with Collisions due to Parenting script 0 Answers
car tutorial' camera adjustment problem 2 Answers