AIPath for car?


I’m trying to derive a steer angle for an AI car from the AIPath script. I’ve been attempting to use the “rot” variable that the script uses to turn the transform to each new path segment. It’s in euler angles so I thought it might work with some tweaking, but my programming skills just aren’t good enough at this point to figure it out. I guess what I would want is an angle from the transform.forward to the new path segment in + or - euler angles since this is what WheelCollider.steerAngle needs. I wonder if anyone has worked on this problem for an AI car.

Thanks so much. I would greatly appreciate any help.


If you need a car script, then you will need to do some major tweaking to the AIPath script. I haven’t worked with WheelColliders much, but if you need an angle from the forward direction to the “direction” variable which the AIPath script uses to move with, you can use Vector3.Angle, that’s the simplest way anyway.

I’ll give that a try and see if I can work it out. Thanks!