function ala() //automated leg adjustment
{
var anga[3];
var leg1_temp[3];
var leg1_temp2[3];
vec_for_vertex(leg1_temp.x,my,189);
vec_set(leg1_temp2,leg1_temp);
vec_add(leg1_temp2,vector(0,0,10));
trace_mode = ignore_me+ignore_passable+ignore_models+ignore_sprites;
result = trace(leg1_temp.x,leg1_temp2.x);
if (result == -1)
{
anga.tilt += 1*time;
anga.roll -= 1*time;
ent_bonerotate(my,"bone2",vector(0,anga.tilt,anga.roll));
}
if (result == 0)
{
anga.tilt = 0; anga.roll = 0;
}
}
I'm using the above code to rotate a bone, but only when a certain vertex is in the ground. The trace works and when the vertex is in the ground the result is -1, and then bone2 should rotate around it's position. the problem is that bone2 is rotating but not at it's position but several quants above it. But when I remove the trace code section and make the bone2 rotate only when I press the key_h, the bone rotates how it should be. So somehow the trace interferes with the bonerotate code.
Hope this all makes sense and that someone can help me, Thanks anyway, Molotov.