Posted By: Anonymous
Physics Ball Ready to use in WED - 05/25/03 21:28
I am having trouble scripting my own physics so could someone write it for me and put in a lvl displaying it..thank you or in german danke!
code:After adding this to your main wdl file, go into WED and add a sphere model and assign the ball action to it. You might wanna place the ball off the ground a ways (if I works like I think it does) so that it will drop to the ground when the level loads and bounce (I think!). I can't test the code (as I have A5pro), but I think it will work properly.var earthgravity[3] = 0,0, -386;
//... add this at the bottom of your main function:
// ph_setgravity( earthgravity );
// ph_selectgroup(1);
// place this below your main function
action ball
{
phent_settype(my, PH_RIGID, PH_SPHERE );
phent_setmass(my, 10, ph_sphere);
phent_setgroup(my, 1);
phent_setelasticity(my, 75, 0);
phent_setfriction (my, 12);
phent_enable(my, 1);
}