Grand Theft Auto: Wisconsin -
10-08-2009, 04:44 PM
Hey peeps I am starting to work on a GTA game. I made a city and put some people and cars in there. The station wagon is following the cubes on the road (for a simulated car path). I would like to know how to get my guy into that moving vehicle and make him control the car.
If your person is controlled by the arrow keys, you could have him set point of veiw to car and set the cars vehicle to the character, and have the character turn invisible.
Since you said the car is following a route, it would have to stop following that route in order to enable player control. In your method for the car's movement along that route, have it use an if/else statement to check if the character is within a very small amount of meters of the car. Then, the character is still moving, but it is also controlling the car.
As for getting out of the car, have a method activated by clicking on the ground which sets all possible cars vehicles to world, and returns them to their preset routes. This should also make the character visible again.