Hello Loopix! Remember me?
I know, how it's mad function > in help file they haven't written that fact, that c_rotate adds angle, not sets it.
Here is example script:
Code:
action ent1111 =
{my.shadow = on;
while(1)
{c_rotate(me,vector(1,0,0),IGNORE_PASSABLE);wait(1);}}
function main()
{video_window(nullvector,nullvector,1,"c_rotate test");video_switch(8,0,1);
fps_max = 64;detail_size = 64;vec_set(sky_color,vector(192,160,128));
level_load("map_water.hmp");wait(3);ent_create("hover.mdl",vector(-256,0,128),ent1111);}
That rotates ent's pan 1degree per sec. so, you need just to replace
Code:
my.pan+=rotate_speed * time_step;
by
Code:
c_rotate(my,vector(rotate_speed * time_step,0,0),IGNORE_PASSABLE);
also replace
result by some
var, for example
Code:
var temp_integer;
to avoid conflicts with c_rotate.
I just noticed that Germanunkol has sended reply while i was typing.
But hes said right, except
result because its modified by
c_rotate and
Code:
my.pan = rotate_angle;
because back rotation can cause lag, and isn't needed because first c_rotate already checked its way.