I have recreated an example that shows exactly my problem in a few lines. Use ArrowUp and ArrowDown to control the player into the shadow. As soon as the player is fully in the shadow of the wall (tunnel), the shadow dissapears, meanwhile I will further check on your responses. thanks again for all your help

//Utility Class

TYPE Txyz

x;y;z

ENDTYPE

//Create Coordinates

GLOBAL pl AS Txyz ; pl.x = -0; pl.y = 0; pl.z = 10 //Player

GLOBAL cam AS Txyz ; cam.x = -50; cam.y = 0; cam.z = 10 //Cam

GLOBAL li AS Txyz ; li.x = -100; li.y = -400; li.z = 500 //Light

GLOBAL pr AS Txyz ; pr.x = 0; pr.y = 0; pr.z = -250 //Road

GLOBAL po AS Txyz ; po.x = 100; po.y = -75; po.z = 0 //Obstacle (Wall)

//Create Objects

GLOBAL player = GENX_OBJ() ; CreateSphere(player,5,10,RGB(255,0,0))

GLOBAL skybox = GENX_OBJ() ; CreateCube(skybox,3000,RGB(40,40,100))

GLOBAL road = GENX_OBJ() ; CreateCube(road,500,RGB(100,100,100))

GLOBAL obstacle = GENX_OBJ(); CreateCube(obstacle,100,RGB(130,10,130))

//Mainloop

WHILE TRUE

X_MAKE3D 1,2000,90

X_CAMERAUP 0,0,1

X_CAMERA cam.x,cam.y,cam.z,pl.x,pl.y,pl.z

//Draw skybox

X_CULLMODE -1

X_DRAWOBJ skybox,0

X_CLEAR_Z

X_CULLMODE 1

//Draw scene

X_MOVEMENT pr.x,pr.y,pr.z ; X_DRAWOBJ road,0

X_MOVEMENT po.x,po.y,po.z ; X_DRAWOBJ obstacle,0

X_MOVEMENT pl.x,pl.y,pl.z ; X_DRAWOBJ player,0

//Shadow light

X_SPOT_LT -3,0,li.x,li.y,li.z,0,0,0,360

//Draw scene again

X_MOVEMENT pr.x,pr.y,pr.z ; X_DRAWOBJ road,0

X_MOVEMENT po.x,po.y,po.z ; X_DRAWOBJ obstacle,0

X_MOVEMENT pl.x,pl.y,pl.z ; X_DRAWOBJ player,0

X_MAKE2D

SHOWSCREEN

//Movement Player

IF KEY(200); INC pl.x; INC cam.x; ENDIF

IF KEY(208); DEC pl.x; DEC cam.x; ENDIF

WEND

//Utility Functions

FUNCTION CreateSphere: num, r, n, col

LOCAL i,j, theta1, theta2, theta3, pi

pi = ACOS(0)*2

IF r < 0 THEN r = -r

IF n < 4 THEN n = 4

X_AUTONORMALS 2 // smooth edges

X_OBJSTART num

FOR j=0 TO INTEGER(n/2) -1

theta1 = j * 2*pi / n - pi/2;

theta2 = (j + 1) * 2*pi / n - pi/2;

FOR i=0 TO n

theta3 = i * 2*pi / n;

X_OBJADDVERTEX r*COS(theta2) * COS(theta3), r*SIN(theta2), _

r*COS(theta2) * SIN(theta3), i/n, 2*(j+1)/n, col

X_OBJADDVERTEX r*COS(theta1) * COS(theta3), r*SIN(theta1), _

r*COS(theta1) * SIN(theta3), i/n, 2*j/n, col

NEXT

X_OBJNEWGROUP

NEXT

X_OBJEND

ENDFUNCTION // n

FUNCTION CreateCube: num, sz, col

// Diese Variablen sind als LOCAL definiert:

// num, sz,

X_AUTONORMALS 1 // For a cube, hard edges

sz=sz/2

X_OBJSTART num

// Front Face

X_OBJADDVERTEX sz, -sz, sz, 1, 0, col

X_OBJADDVERTEX -sz, -sz, sz, 0, 0, col

X_OBJADDVERTEX sz, sz, sz, 1, 1, col

X_OBJADDVERTEX -sz, sz, sz, 0, 1, col

X_OBJNEWGROUP

// Back Face

X_OBJADDVERTEX -sz, sz, -sz, 1, 1, col

X_OBJADDVERTEX -sz, -sz, -sz, 1, 0, col

X_OBJADDVERTEX sz, sz, -sz, 0, 1, col

X_OBJADDVERTEX sz, -sz, -sz, 0, 0, col

X_OBJNEWGROUP

// Top Face

X_OBJADDVERTEX -sz, sz, sz, 0, 0, col

X_OBJADDVERTEX -sz, sz, -sz, 0, 1, col

X_OBJADDVERTEX sz, sz, sz, 1, 0, col

X_OBJADDVERTEX sz, sz, -sz, 1, 1, col

X_OBJNEWGROUP

// Bottom Face

X_OBJADDVERTEX sz, -sz, -sz, 0, 1, col

X_OBJADDVERTEX -sz, -sz, -sz, 1, 1, col

X_OBJADDVERTEX sz, -sz, sz, 0, 0, col

X_OBJADDVERTEX -sz, -sz, sz, 1, 0, col

X_OBJNEWGROUP

// Right face

X_OBJADDVERTEX sz, sz, -sz, 1, 1, col

X_OBJADDVERTEX sz, -sz, -sz, 1, 0, col

X_OBJADDVERTEX sz, sz, sz, 0, 1, col

X_OBJADDVERTEX sz, -sz, sz, 0, 0, col

X_OBJNEWGROUP

// Left Face

X_OBJADDVERTEX -sz, -sz, sz, 1, 0, col

X_OBJADDVERTEX -sz, -sz, -sz, 0, 0, col

X_OBJADDVERTEX -sz, sz, sz, 1, 1, col

X_OBJADDVERTEX -sz, sz, -sz, 0, 1, col

X_OBJNEWGROUP

X_OBJEND

ENDFUNCTION // sz