action water_block()
{
while(!me)wait(1);
//this will be the min/max of the water block
VECTOR water_min;
VECTOR water_max;
//this should be your player's min/max you dont need this
//i did this for the camera as a demo
VECTOR player_min;
VECTOR player_max;
while(me)
{
//water min/max values plus position
vec_set(water_min,my.min_x);
vec_set(water_max,my.max_x);
vec_add(water_min,my.x);
vec_add(water_max,my.x);
//player min/max
//this should be your player sizes you wish to test intersection against
vec_set(player_min,vector(camera.x-50,camera.y-50,camera.z-50));
vec_set(player_max,vector(camera.x+50,camera.y+50,camera.z+50));
//check if player min/max , intersects with , water min/max
if(c_intersect(water_min,water_max,NULL,player_min,player_max,NULL)==-1)
{
DEBUG_VAR(1,100);
draw_box3d(water_min,water_max,COLOR_GREEN,100);
}
else
{
DEBUG_VAR(0,100);
draw_box3d(water_min,water_max,COLOR_RED,100);
}
wait(1);
}
}