Posted By: Stansmedia
Effective floor placement for movement - 06/19/14 19:53
I'm using this code for gravity/floor placement of my first person movement code. I keep getting stuck in the ceiling when the floor and ceiling slope together and meet like this shape: <
Code:
dist_down = c_trace(my.x,vector(my.x,my.y,my.z-5000),IGNORE_ME | IGNORE_PASSABLE | USE_BOX ); //vec_set(normalplane,hit.nx); z_spot = hit.z; if(my.z > z_spot + 16) { zforce -= time_step * accel; accel += time_step *0.25; } else { zforce = 0; accel = 0; }