It has always bothered me that the steering mechanism for a car through script control with the -1, 0, 1 options do not allow for fine steering.
The fact that the car steers perfectly with the keyboard, and also follows a path with very smooth steering, often had me thinking on this paradox.
After playing with the pathfinder and carAI, which uses a target to move the car, the obvious struck me. The key to controlling a car through script - is to use a target which is controlled by a script - and then leave the steering to the car itself.
Here is a little project which does just that. You can steer an AICar with a mouse. This demos serves to show that it is easy to implement a network, keyboard, mouse, joystick, text-file, dll, or whatever controller you wish, by means of a script
I have used the top-speed factor to provide a�Power� to the car, which can be controlled by the mouse wheel. There are many ways to control the car acceleration from script, but I opted for a simple solution in this demo.
The angle of the target in relation to the direction of the car is controlled through the location of the mouse on the screen.. To the left, and to the right of the center of the screen, control the direction of rotation of the target around the car.
Enjoy.
The fact that the car steers perfectly with the keyboard, and also follows a path with very smooth steering, often had me thinking on this paradox.
After playing with the pathfinder and carAI, which uses a target to move the car, the obvious struck me. The key to controlling a car through script - is to use a target which is controlled by a script - and then leave the steering to the car itself.
Here is a little project which does just that. You can steer an AICar with a mouse. This demos serves to show that it is easy to implement a network, keyboard, mouse, joystick, text-file, dll, or whatever controller you wish, by means of a script
I have used the top-speed factor to provide a�Power� to the car, which can be controlled by the mouse wheel. There are many ways to control the car acceleration from script, but I opted for a simple solution in this demo.
The angle of the target in relation to the direction of the car is controlled through the location of the mouse on the screen.. To the left, and to the right of the center of the screen, control the direction of rotation of the target around the car.
Enjoy.