I'm having a problem....i have a ball which iv got behaving as such, so it collides with walls/models/pink elephants and bounces....great....but i need it to gain speed when it collides with anything. iv been trying for the last couple of hours and i cant get the phent_addforceglobal etc to work. i used the code in aum25 as a starter but to save anybody time, heres the code.
Code:
function create_ball()
{
if ((balls < 1) || (ball_ptr != null)) {return;} // ran out of balls -> stop
ball_ptr = ent_create(ball_mdl, ball_pos, init_sphere);
balls -= 1;
}
function init_sphere()
{
phent_settype(my, ph_rigid, ph_sphere); // enable physics for this ball
phent_setmass(my, 100, ph_sphere); // the ball has 1kg (2 lbs) and behaves like a sphere
phent_setfriction(my, 0); // friction
phent_setelasticity(my, 100, 0); // bounce a lot
temp.x = 0;
temp.y = -250;
temp.z = 0; // earth gravity factor, g = 9.81 m/s2
ph_SetGravity(temp); // set gravity
while (my.z > -150) {wait (1);} // the ball has approached the floor
if (EVENT_TYPE == Event_impact)
{
temp2.x = 0;temp2.y-=100;temp2.z=0;
ph_setgravity(temp);
}
wait(1);
}
any help would be mega appreciated.
Negioni.