I'm a beginner of 3dgs a7.
while I using it, there seems to be some problem I can't solve.
1)//i wrote this function which has a parameter "ENTITY*"
function rotate_entity(ENTITY* entity, rotate_angle, rotate_speed)
{
if(entity.pan == rotate_angle)
{
return;
}
result = ang(rotate_angle - entity.pan);
if ( result>0)
{
entity.pan += rotate_speed*time_step;
}
if ( result<0)
{
entity.pan -= rotate_speed*time_step;
}
if(ang(rotate_angle - entity.pan)>0 && result<0)
{
entity.pan = rotate_angle;
}
if( ang(rotate_angle - entity.pan)<0 && result>0)
{
entity.pan = rotate_angle;
}
}
//and i would call the function like this
rotate_entity(me, temp.x, 20);

//the result is when the game calls it, the game just simply crash without any tips.

2)
trace_mode = ignore_me+ignore_passable+use_box;
result = trace(vector(my.x, my.y, my.z-my.z_offset), vector(my.x, my.y, my.z-4000));
//the code above works well,but when i change it into follow
result = c_trace(vector(my.x, my.y, my.z-my.z_offset), vector(my.x, my.y, my.z-4000),ignore_me|ignore_passable|use_box);
//the movement of my model seems to be shaking,just being wrong.
//ps: i use the code to control the z coordinate.

would anybody give me some help. thanks a lot.