I have looked for awhile on how to incorporate something like this into my code and just can’t figure it out.
So the Code I have is on the two front tires of the vehicle, and the Car is following the Target “Player” which everything is working the wheels turn as well as the wheel Colliders but if the player was to run a circle around the vehicle the wheels would turn a full 360 Degrees which I don’t want. and I was wondering how to add a Max steer angle on the y axis so they can only turn at max a 30-45 degree angle.
Here is the code thanks in advance!
Vector3 targetPos = new Vector3(target.transform.position.x, frontDriverT.position.y, target.transform.position.z);
Vector3 targetPos2 = new Vector3(target.transform.position.x, frontPassengerT.position.y, target.transform.position.z);
frontDriverT.LookAt(targetPos);
frontPassengerT.LookAt(targetPos2);
eulerAngY = frontDriverT.localEulerAngles.y;
eulerAngYTwo = frontPassengerT.localEulerAngles.y;
frontDriverW.steerAngle = eulerAngY;
frontPassengerW.steerAngle = eulerAngYTwo;