Finding Gaps

Posted By: jumpman

Finding Gaps - 06/06/17 04:37

Hi everyone,

does anyone have any pseudo code or theory when it comes to finding gaps in the floor for jumping? I have a simple AI that moves in a straight line towards its target, and I just want it to be able to jump over gaps. Is there a way to find the gap in the floor? Whether the floor is block/model?

I currently already have a crude gap checking script, which uses vec_lerp and traces within a loop. It works ok, but I wanted to know if there was a more elegant way.
Posted By: Dooley

Re: Finding Gaps - 06/06/17 06:05

c_trace?

Maybe have it check which floor level the trace hits. If it hits the lower level - i.e. it reaches the gap, then it goes into jump mode. When it hits the higher level, it continues to do the normal, non-jumping movement.
Posted By: 3run

Re: Finding Gaps - 06/06/17 09:52

I once made movement code with auto jumping (for player, but it's the same way for AI too I guess). It used to work with c_trace as well. If you will be interested, you can find it on my webpage under downloads.
© 2024 lite-C Forums