Not too good way for gravity!
Here can put on two ways to get nice gravity!
First is to use c_move absolut z axe for falling with simple formule --> a=gt^2/2
but then only minuss ir that when you will ease downward even from 5 degrees slope on ground.
If you will use this formule together with c_trace then again minuss is that when you will not slope down even from 70 degrees.
Ok - no more theorees.
Here is example:
var gravitacija=9.8;
function gravitate
{
result = c_trace(vector(my.x,my.y,my.z),vector(my.x,my.y,my.z - 40000),ignore_me+use_box);
my.speks_z =((gravitacija * sekundes^2)/2);
my.kustiba_z =(-1*my.speks_z);//
if(result=<1)
{
sekundes=0.4;//this keep some g force even on ground too and dont let sum secunds after coming to ground.
}
}
function main_hero_function
{
sekundes+=time_step/16;//16 frames in second then 1 second is 16 timesteps/16!!
....
c_move(my,vector(my.kustiba_x,my.kustiba_y,0),vector(0,0,my.kustiba_z),use_box + glide + activate_trigger);
}
P.S. if you wil try something with disable_z_glide or else - you can get really really comfortable gravity with vertical friction.
Last edited by Arrovs; 06/25/08 12:00.