- Home /
WheelCollider position mapping problem: Wheels in the air?!
Hello, I am currently working on some car physics and i am trying to make the wheel-objects move the same way as the wheelColliders. I am using this script for it:
RaycastHit hit;
if(Physics.Raycast (wheelFL.transform.position, -wheelFL.transform.up, out hit, wheelFL.radius+wheelFL.suspensionDistance)){
wheelPosFL.position = hit.point+wheelFL.transform.up*wheelFL.radius;
Debug.Log ("hit");
}
else {
wheelPosFL.position = wheelFL.transform.position-wheelFL.transform.up*wheelFL.suspensionDistance;
Debug.Log ("noHit");
}
This is only for the Front-Left Wheel. But instead of being where it should be, my wheel decides to be a few inches above the ground, just like this:
It also says "noHit" in the console all the time. Please help me! In every Tutorial, I watched, this worked perfectly, therefore I am very confused right now :(
Greetings from Germany.
Checked all your child transforms and collider centres?
Answer by LetsHaveFun · Oct 22, 2013 at 06:59 PM
Try lowering the suspension Distance, maybe this helps.
This decreases the Problem but it doesn't solve it. I need a solution! :( But thanks for the advise anyway :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613120436im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
WheelCollider Position is not in the right place, why? 1 Answer
How can I call this player transform.position code once, then stop? 2 Answers
Wheel collider object attachment? 1 Answer
Wheel Colliders with visual wheels problem 0 Answers
Best way to make wheels freely turn / swivel? (Like a shopping cart) 2 Answers