Effective floor placement for movement

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;
      }

Posted By: FoxHound

Re: Effective floor placement for movement - 06/19/14 22:43

use c_move and put in a negative z movement, the built in system is a lot better at this then script can do.
Posted By: Stansmedia

Re: Effective floor placement for movement - 06/20/14 06:20

When I walk up slopes, it bottoms out anyway. I had the script keeping the player at a certain level above the trace to stop from bottoming out, but this caused gliding up near vertical slopes - not to mention, getting jammed into ceilings... which is still happening.
Posted By: DLively

Re: Effective floor placement for movement - 06/20/14 17:52

An idea is: Trace above. If the trace hits then the player could duck.. All the while following the gravity algorithm. This combined with good collision detection should prevent the camera from "looking through" meshes.

Gravity is covered in the AUMS I think its in the 70's laugh
Posted By: Stansmedia

Re: Effective floor placement for movement - 06/20/14 18:19

Looking through mesh isn't the problem. It's physically getting stuck.
Posted By: FoxHound

Re: Effective floor placement for movement - 06/20/14 18:55

Use glide with C_move and you won't get stuck going up hills
Posted By: DLively

Re: Effective floor placement for movement - 06/21/14 13:42

Quote:

Looking through mesh isn't the problem. It's physically getting stuck.

Well, the AUMS are still a good place for you to be looking wink As mentioned its covered within.

Btw, here it is. Took me all of 3 minutes to find it xD
© 2024 lite-C Forums