Posted By: Helghast
Gravity and A7... - 06/02/08 09:11
Ok, so i have been working a lot lately on creating an RPG template code... all aspects work good, except gravity...
I had implemented kingdom hearts tutorial, and that worked, to some extent. What happened that when running up hills (my levels are made from models with polygon collision) at low FPS, he wouldnt climb the hill at all, and just stand at the bottom of it doing nothing.
So i decided i would simply use single point collision and snap the player to that target.z value (as i have done forever in A6 and proved working!)
great, so i take this (A6) code:
and convert that to A7:
Guess what... it doesnt work, at all!
can anyone here share a code that does work with single point "gravity" ? I'm really desperate for this!
thanks in advance,
Dennis
I had implemented kingdom hearts tutorial, and that worked, to some extent. What happened that when running up hills (my levels are made from models with polygon collision) at low FPS, he wouldnt climb the hill at all, and just stand at the bottom of it doing nothing.
So i decided i would simply use single point collision and snap the player to that target.z value (as i have done forever in A6 and proved working!)
great, so i take this (A6) code:
Code:
function set_gravity { var target_trace[3]; // variable for temp storage of the trace vec_set(target_trace, my.x); target_trace.z -= 5000; trace_mode = ignore_me + ignore_sprites + ignore_models + use_box + ignore_passable; my.z = -trace(my.x, target_trace); }
and convert that to A7:
Code:
function handle_gravity() {// pulls objects to the ground ;) *hence the name "gravity":P* VECTOR target_trace; // variable for temp storage of the trace vec_set(target_trace, my.x); target_trace.z -= 5000; result = c_trace(my.x, target_trace, IGNORE_ME | IGNORE_PASSABLE | USE_BOX | USE_POLYGON); vec_set(my.z, target.z); my.z += 25; }
Guess what... it doesnt work, at all!
can anyone here share a code that does work with single point "gravity" ? I'm really desperate for this!
thanks in advance,
Dennis