I am trying to write the script for the player to enter a vehicle. The player outside the vehicle and driving the vehicle have different camera codes. So I managed to make the player enter the vehicle when he goes to a certain spot, but the camera does not change. he camera in the vehicle works the same way as if the player is not in the vehicle. The both cameras were tested, so it is not the problem in the camera codes. I think I just call the function in the wrong part of the script. HELP!! Here is the script:
Code:
var camera_switch = 1;
function camera_invehicle(){
while(1){
camera_invehicle code here
wait(1);}}
function camera_outvehicle(){
while(1){
camera_outvehicle code here
wait(1);}}
action player(){
if(camera_switch == 1){
camera_outvehicle();}
if(camera_switch == 2){
camera_invehicle();}
while(1){
if (player.x != vehicle.x){ // the player is not in the vehicle
camera_switch = 1;}
if (player.x == vehicle.x){ // the player is in the vehicle
camera_switch = 2:}
wait(1);}


I don't know whether it is alright to call two functions in one action, though I tried a lot variants, like writing the two camera codes directly in the action, etc.... nothing worked properly, I mean the camera switch didn't work, the camera remained the same as if the player is not in the vehicle

Last edited by BastovBros; 11/28/09 12:20.

a generator of dull questions smile