I can't get my car move forward with the given scripts.
Dear Unity users,
I am having problems in the scripts I got from GitHub made by EthanReid (Link: https://github.com/EthanReid/unity-scripts) . I tried to apply the scripts onto my car just for it to not drive forward. The wheels do rotate but only in a fixed position. I tried several ways to make the car move but the car's driving was so messed up. I used the Wheel script because it is a required component of the CarController script. The WheelSkid script from the UnitySkidmarks library in GitHub provides a WheelCollider but I can't make use of it because the CarController relies on the Wheel script which has more technical variables than a WheelCollider. Is there anything wrong with the scripts I used from GitHub or is this just a mistake I made on my end? Also, this is how I setup the car GameObject in Unity with the given scripts.
Answer by joseenriquejoson · Mar 10 at 12:56 AM
Dang these nights, I founded out that I just need to tweak the scripts. Sorry for bothering you guy.
Hi @joseenriquejoson, can you please briefly share which parts of the scripts you needed to tweak?
I think I managed to assign the scripts to the correct game objects, but I can't figure out why the car is leaning into the wrong direction in the corners. So when steering left the left side sinks to the floor.
I'm a beginner at C#, so I tried brute forcing it by editing almost every variable from plus to minus and vice versa. Do I have to do anything with the Pacejka coefficients?
Another question: what values are advisable for the gear ratios? I've tried so many combinations (e.g. 5 gears from -2, 0, 1, 1.5, 2) but the car either accelerates to max rpm in first gear and continues accelerating without shifting or gets stuck at around 3000 rpm.
Thanks in advance!
Edit: I figured out the leaning part: my wheels are located too far below the car so I adjusted them up on the Y axis in the editor - that caused the issue. Additionally my custom CenterOfMass object wasn't positioned correctly.
Edit2: I guess I also figured out the gear ratios: starting high and going lower. Now that I have it figured out it seems obvious.
Your answer
Follow this Question
Related Questions
Best way to stop a car after a finish line? 1 Answer
Car wont move 0 Answers
How to rotate wheel colliders on the Y axis since they can't be rotated in the editor? 0 Answers
car with wheel collider fall thought road collider 1 Answer
How to stop the Unity Skycar Car without ending up in reversing? 0 Answers