i'm programming a (currently)little side scroller with the physX engine and everything works fine... but now one of my classmates had the idea to add more than one layer ,between that you should be able to change ingame. but after the programming(that works fine too) an other part of my skript got stuck. Not with an engine error or a programming error, the programm is starting correctly and works fine until i jump into the water... then the Entity is forced so strong, that it flies through walls. also you don't get damage. after that i extracted the uncommented part as the source of the error:
Code:
if(my.STATE == 3)
		{
			
			kampfkeksforce.z = -50 * time_step * (key_cuu - key_cud);  
			pXent_addtorquelocal(my, kampfkeksforce);
		
			if(my.y <= 10  && inwater != 1 && inmilk != 1 && inlava != 1)
			{
				kekswillumkippen = 2;
			   /*   movinglayer = 0;
				pXent_setposition(my,vector(my.x,0,my.z));
				pXent_rotate(my,nullvector,vector(0,0,90));
				pXent_setbodyflag(my,NX_BF_FROZEN_POS_X, 0);
				pXent_setbodyflag(my,NX_BF_FROZEN_POS_Y, 1);
				my.STATE = 1;   */
			}else if(my.y >= 1290  && inwater != 1 && inmilk != 1 && inlava != 1) //layer 2
			{
				kekswillumkippen = 2;
			   /*   movinglayer = 1;
				pXent_setposition(my,vector(my.x,1280,my.z));
				pXent_rotate(my,nullvector,vector(180,0,90));
				pXent_setbodyflag(my,NX_BF_FROZEN_POS_X, 0);
				pXent_setbodyflag(my,NX_BF_FROZEN_POS_Y, 1);
				my.STATE = 1;  */
			}
			
		}

(the uncommented part) if it's not commented this part:
Code:
var scanned1;
		var scanned2;
		var scanned3;
		var scanned4;
		var scanned5;
		var scanned6;
		var scanned7;
		var scanned8;
		
		c_ignore(1,3,4,5,0);
		scanned1 = c_trace(vector(my.x,my.y,my.z),vector(my.x-20,my.y,my.z),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		c_ignore(1,3,4,5,0);
		scanned2 = c_trace(vector(my.x,my.y,my.z),vector(my.x+20,my.y,my.z),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		c_ignore(1,3,4,5,0);
		scanned3 = c_trace(vector(my.x,my.y,my.z),vector(my.x,my.y,my.z-20),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		c_ignore(1,3,4,5,0);
		scanned4 = c_trace(vector(my.x,my.y,my.z),vector(my.x,my.y,my.z+20),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		
		c_ignore(1,3,4,5,0);
		scanned5 = c_trace(vector(my.x,my.y,my.z),vector(my.x-20,my.y,my.z-20),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		c_ignore(1,3,4,5,0);
		scanned6 = c_trace(vector(my.x,my.y,my.z),vector(my.x+20,my.y,my.z+20),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		c_ignore(1,3,4,5,0);
		scanned7 = c_trace(vector(my.x,my.y,my.z),vector(my.x+20,my.y,my.z-20),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		c_ignore(1,3,4,5,0);
		scanned8 = c_trace(vector(my.x,my.y,my.z),vector(my.x-20,my.y,my.z+20),IGNORE_ME | USE_BOX | USE_POLYGON | IGNORE_WORLD | IGNORE_MAPS);
		
		if(scanned1 > 0 || scanned2 > 0 || scanned3 > 0 || scanned4 > 0 || scanned5 > 0 || scanned6 > 0 || scanned7 > 0 || scanned8 > 0)
		{
			if(leben < 480 && gotdamage <= 0)
			{
				leben+=80;
				gotdamage = 20;
			}
		} 
		
		
		if(gotdamage > 0)
		gotdamage -= 1*time_step;
		
		if(leben >= 400)
		{
			deathtimes += 1;
			leben = 0;
		}
		
		
		
		if(my.z < -2024 && my.x > 7576 && my.x <10111)
		{
			inwater = 1;
		}else if(my.z < -2024 && my.x > 4040 && my.x <6578)
		{
			inmilk = 1;
			inwater = 1;
			
			pXent_setdamping(my,100,100);
		}else if(my.z < -2024 && my.x > 10672 && my.x <13844)
		{
			inlava = 1;
			pXent_setdamping(my,100,100);
		}else
		{
			inmilk = 0; 
			inwater = 0;
			inlava = 0;
			pXent_setdamping(my,10,100);
		}
		
		
		if(inwater == 1)
		{	
			
			pXent_addforceglobal(my,vector(0,0,40*time_step),vector(my.x,my.y,my.z));	
			
			VECTOR kampfkeksforcewater;
			kampfkeksforcewater.x = 20 * time_step * (key_cur - key_cul); 	
			pXent_addforceglobal(my, kampfkeksforcewater,vector(my.x,my.y,my.z));
		}else if(inmilk == 1)
		{	
			
			pXent_addforceglobal(my,vector(0,0,-30*time_step),vector(my.x,my.y,my.z));	
			if(leben < 480 && gotdamage <= 0)
			{
				leben+=80;
				gotdamage = 50;
			}
			
			VECTOR kampfkeksforcewater;
			kampfkeksforcewater.x = 20 * time_step * (key_cur - key_cul); 	
			pXent_addforceglobal(my, kampfkeksforcewater,vector(my.x,my.y,my.z));
		}else if(inlava == 1)
		{	
			
			pXent_addforceglobal(my,vector(0,0,13*time_step),vector(my.x,my.y,my.z));	
			
			if(gotdamage <= 0)
			{
				leben = 400;
				gotdamage = 10;
			}
			
			VECTOR kampfkeksforcewater;
			kampfkeksforcewater.x = 10 * time_step * (key_cur - key_cul); 	
			pXent_addforceglobal(my, kampfkeksforcewater,vector(my.x,my.y,my.z));
		}



- fixed it... -




Last edited by LPF; 03/08/12 20:10.

..oooO .........
..(....)..Oooo..
...\..(...(....)..
....\_)....)../..
...........(_/...
...ICH WAR....
........HIER....