So I've put together a script that basically works as an aimbot, however it only works through a client's camera
and it's server-sided. (so don't get mad) :P
function LockAim(%client, %targetName)
{
if(!%client.isLockAim)
return;
%camera = %client.camera;
if(!isObject(%camera))
return;
%target = findClientByName(%targetName).player;
if(!isObject(%target))
return;
%targetPos = %target.getPosition();
//Get the camera to aim at the player
%pos = %camera.getPosition();
%delta = vectorSub(%targetPos, %pos);
%deltaX = getWord(%delta, 0);
%deltaY = getWord(%delta, 1);
%deltaZ = getWord(%delta, 2) + 1;
%deltaXYHyp = vectorLen(%deltaX SPC %deltaY SPC 0);
%rotZ = mAtan(%deltaX, %deltaY) * -1;
%rotX = mAtan(%deltaZ, %deltaXYHyp);
%aa = eulerRadToMatrix(%rotX SPC 0 SPC %rotZ);
%camera.setTransform(%pos SPC %aa);
schedule(33,0,LookAt,%client,%targetName);
}
The problem is that whenever the camera or the player moves, the screen gets really choppy. As if it stops aiming for a brief
moment then re-captures the target. Technically yes, there is a delay (33 milliseconds) however I tried shortening it and it
didn't seem to help. Is there a way to have the camera stay locked on, in a smoother way? I'm using this for a theater type
mode for recording, etc. so you can understand why it can't be choppy