Ok...now I've got 3 different camera views for my player. 1st person, 3rd person behind, and an alternate 3rd person behind. In my two 3rd person cameras, I have the camera.tilt set to a static value, but in my 1st person camera, I want the player to be able to adjust the camera.tilt with the pgup-pgdn keys and reset to 0 with "home" key. It works as long as I call my 1st person view first, but as soon as I change to either 3rd person view, and then try to switch back, the camera.tilt stays at the value of the 3rd person view you were in. Switching between the two third person views works just fine...but try to go back to 1st person view...and not only does the 1st person camera.tilt continue to be the same tilt as the last 3rd person view you were in, but the pgup-pgdn keys no longer funtion.

I figure it has to be something simple. I've trying resetting the camera.tilt to 0 in the camera_select function "if" statements (if key_7){camera.tilt = 0;}, but it only goes to zero briefly and then returns to whatever the previous 3rd person tilt was....or stays at 0 if you hold down the key_7.

I'm just not sure why the camera.tilt sticks.....

Again...here's my functions.

Code:
function camera_1stperson()
{
	while(1)
	{
		camera.x = my.x + 11 * cos(my.pan);
	   camera.y = my.y + 11 * sin(my.pan);
	   camera.z = my.z + 25;
	  	camera.pan = my.pan;
		camera.tilt += (key_pgup-key_pgdn)*5*time_step;
	   if(key_home)
	   {camera.tilt = 0;}
	   camera.roll = 0;
	   wait(1);
    }
}

function camera_3rdperson()
{
	while(1)
	{
	   camera.x = my.x - 150 * cos(my.pan);
	   camera.y = my.y - 150 * sin(my.pan);
	   camera.z = my.z + 50;
	   camera.pan = my.pan;
		camera.tilt = -13;
	   camera.roll = 0;
	   wait(1);
    }
    
}
function camera_3rdperson2()
{
	while(1)
	{
	   camera.x = my.x - 250 * cos(my.pan);
	   camera.y = my.y - 250 * sin(my.pan);
	   camera.z = my.z + 200;
	   camera.pan = my.pan;
	   camera.tilt = -25;
	   camera.roll = 0;
	   wait(1);
    }
}

function select_cameras()
{	
	while(1)
	{
		if(key_7)
		{camera_1stperson();}
		if(key_8)
		{camera_3rdperson();}
		if(key_9)
		{camera_3rdperson2();}
		wait(1);
	}
}



If I take out the "camera.tilt += (key_pgup-key_pgdn)*5*time_step;" code altogether and just hard-code "camera.tilt = 0;}, it works...but then I have no player tilt.

Again...any help/thoughts/ideas are really appreciated!

-Emo


"To one who has faith, no explanation is necessary. To one without faith, no explanation is possible." - St. Thomas Aquinas