This function works great when the define of 'genGravity'is set at 10 but crashes WED or the Script editor when I set it to 100 when the object collides with the ground. (mdl IceX2.0 generated.) Has anyone seen this in the past or have an idea of what's going on?
(6.40.5 Pro)
Code:
function addToPhysics()
{
my.passable =OFF;
phent_settype(my,
PH_RIGID, // rigid entity
PH_SPHERE); // collision hull
phent_setmass(my,
10, // mass
PH_SPHERE); // hulltype (shape of object for rotational behavior)
var linear = 10;
var angular = 10;
phent_setdamping(my, linear, angular);
phent_setgroup(my, 2); // group of object
phent_setelasticity(my,
40, // bounciness (0..100)
0); // minimum speed
ph_setgravity(vector(0,0,-genGravity)); // earth gravity
phent_clearvelocity(my);
ph_selectgroup(15); // active group 2 objects
// phent_enable(my, OFF);
phent_clearvelocity(my);
}