help
Posted: Sun Aug 01, 2010 11:44 am
how do i get an actor to follow the mouse in rotation, as in a turret following the mouse to aim? cos im stumped
angle=direction(x,y,xmouse,ymouse)/nframes;
angle=direction(x,y,mouse.x,mouse.y)/nframes;
jimmynewguy wrote:if you mean rotating to face the mouse then use
- Code: Select all
angle=direction(x,y,xmouse,ymouse)/nframes;
But for some reason xmouse and ymouse always tend to be off ...
direction(xscreen, yscreen, xmouse, ymouse);
double dir = direction(xscreen, yscreen, xmouse, ymouse);
animpos = (int)((dir + 5) * .1) % 36;
DilloDude wrote:In you're example, you're adjusting angle. angle is for movement, and requires directional_velocity.