I know I've posted a lot of issues about Newton, I'm kinda in between newton and A6 physics. I'm trying to get a bullet impact working for the A6 physics, but no success... spins, no movement and it always spins in one dircetion. My code:
Code:
function physics_hit
{
if (you.skill1 == 4) //checks if entity that hit it was a bullet
{
var force_vector;
force_vector.x = you.skill8*10;
force_vector.y = 0;
force_vector.z = 0;
vec_rotate(force_vector, you.pan); //rotates it to give direction of bullet
phent_addforcelocal (my, force_vector, you.x);
}
}
Action PhysicsCrate
{
my.skill96 = 1; //smoke
my.skill98 = 1; //sparks
my.skill99 = 1;//I'm a physics object
phent_settype(my, PH_RIGID, PH_BOX); // sets the object within the physics engine
phent_setmass(my, 10, PH_BOX); // set the entity's mass
phent_setfriction(my,30); // set the enitity's friction\
phent_setdamping(my,50,100);
phent_setelasticity(my, 0, 0); // set the enitity's elasticity
phent_enable(my, ON); // enable the phent enitity
my.ENABLE_IMPACT = on;
my.event = physics_hit;
}
Anybody know how to fix this?