From the course: ARKit and Unity: Build a Drivable Car in Augmented Reality

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Rear-wheel drive script, part 2

Rear-wheel drive script, part 2

- [Instructor] As you saw in the previous video that the car is moving perfectly, it's rotating as well but the front wheels of the car are not rotating and are not moving left and right as it should. So let me show you what exactly is happening. If I hide this front left wheel and select the wheel collider then if I drag the car you can see the wheel collider is changing its position that is it is moving forwards and backwards and also it's changing its rotation to left and right. So we are going to fix that in this video. So to fix our problem we have to do two things. First we have to keep the position of the wheel model same as the position of the wheel collider at all times. So let me show you what I mean. When the car moves the position of the wheel collider changes. So along with changing position of the wheel collider, the 3D wheel model should also change its position like this. And the second thing is rotation. So when we press the left and right arrow keys, the wheel…

Contents