- Home /
Help with Steering
I'm attempting to build an autonomous line follower and having problems getting my car object to follow the white line. I'm using wheel colliders on the hind wheels but for some reason the car object wont turn. The problem might be with the Turn functions. I'm wondering if just setting a steer angle turns right and its negative turns left.
Sample Code :
void TurnRight()
{ if (sensor1.s1_detect && sensor2.s2_detect && !sensor3.s3_detect)
{
SteerAngle = 6;
FL.steerAngle = SteerAngle;
FR.steerAngle = SteerAngle;
}
}
void TurnLeft()
{
if (!sensor1.s1_detect && sensor2.s2_detect && sensor3.s3_detect)
{
SteerAngle = 6;
FL.steerAngle = SteerAngle;
FR.steerAngle = SteerAngle;
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220612115752im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
What is transform.forward? 3 Answers
What is fow meaning when doing zoom in/out with camera ? 2 Answers
Can you stop certain scripts from being compiled during build? 1 Answer
How can i make the transform rotation Quaternion.identity but smooth ? 1 Answer
How do I make my model's head and body rotate with the mouse? 2 Answers