vec_set(wall_finder.x,vector(200,0,26));//26 being the position of my hands in wall hanging animation
vec_rotate(wall_finder.x,my.pan);
vec_add(wall_finder.x,my.x);
vec_set(from_player.x,vector(0,0,26));
vec_rotate(from_player.x,my.pan);
vec_add(from_player.x,my.x);
wall_distance = c_trace(from_player.x,wall_finder.x,use_box | ignore_me | ignore_passable);
IF(wall_distance == 0)//define this further so it does not work when on ground and only up against a wall,eg, when jumping and wall_distance previously was != 0
{
gravity_on = 0;//condition for gravity to work when at 1
current_speed = 0;//my forward motion stopped
//now play wall hanging animation here
}