# SolvedCSGO How to Stop aimbot from snapping

#### F4DE

##### Newbie
Full Member
Hi,

I've created an aimbot, and it works pritty good. Now, the only thing that I don't like is that it kinda 'snaps' to the enemies head. What I mean by this, is that it doesn't go in a smooth way to the enemies head but it litterly teleports the crosshair to the head.

So, how can I make the crosshair actually go smoothly to the enemies head?
Thanks!

#### Rake

old UT engine uses "Rotational Unreal Unit", probably the same for the current iteration, just look it up in the SDK for the version of unreal engine the game you're hacking was built using

360 degrees = 65536 unreal rotational units therefore

RUU / degrees = 182.0444444
65536 / 360 = 182.0444444

So multiply your degres by 182.0444444 to get RUU
Or conversly divide your RUU by 182.0444444 to get degrees

I used this in my UT1999 aimbot and it worked

This is legacy Unreal Engine but the site is awesome:
https://wiki.beyondunreal.com/Legacy:Unreal_Unit#Angle_conversion_constants

#### GAFO666

##### Hacker
Meme Tier VIP
if you want to smooth it then you dont set it directly to the position, you rather create a moving patch which gets followed by the aimbot.
thatfor you just calculate the line between the head and the cross and set each point with a delay of your choice to get more smooth closer

#### Rake

1)You need to calculate the angle from you to the enemy
2)Subtract your current angle from the aimbot angle
4)Add this quotient from the above division to your current view angles over a span of time

Some functions you need:
C++:
vec3_t CalcAngle(vec3_t src, vec3_t dst)
{
vec3_t angles;
angles.x = (-(float)atan2(dst.x - src.x, dst.y - src.y)) / PI * 180.0f + 180.0f;
angles.y = (atan2(dst.z - src.z, Distance(src, dst))) * 180.0f / PI;
angles.z = 0.0f;
return angles;
}

{
vec3_t sum;
sum.x = src.x + dst.x;
sum.y = src.y + dst.y;
sum.z = src.z + dst.z;
return sum;
}

vec3_t Subtract(vec3_t src, vec3_t dst)
{
vec3_t diff;
diff.x = src.x - dst.x;
diff.y = src.y - dst.y;
diff.z = src.z - dst.z;
return diff;
}

vec3_t Divide(vec3_t src, float num)
{
vec3_t vec;
vec.x = src.x / num;
vec.y = src.y / num;
vec.z = src.z / num;

return vec;
}

float Magnitude(vec3_t vec)
{
return sqrtf(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z);
}

vec3_t Normalize(vec3_t src)
{
vec3_t vec = Divide(src, Magnitude(src));
return vec;
}
C++:
int smoothInterval = 5;

vec3_t aimbotAngle= CalcAngle(localPlayer->pos, enemy->pos);
vec3_t diff = Subtract(diff, aimbotAngle);
vec3_t smoothAngle = Divide(diff, smoothInterval);

//Then in a different thread or some shit:
for (int i = 0; i < smoothInterval; i++)
{
Sleep(10);//modify this as needed
}
That's what I would do but I haven't tested it, might need some sort of normalizing

#### Maxillions

##### Newbie
Like GAFO666 said, rather than just moving your cursor directly to the head's position, you should create a movement system that will move over time.

Last edited:

#### Zac

##### Squally Dev
Fleep Tier Donator
Nobleman
Just use some sort of interpolation function. Linear is probably easiest, if you wanna get fancy there is Lagrange/Polynomial/Spline

#### F4DE

##### Newbie
Full Member
Thanks for the help, I tried to implement the code but I get an error on 'Magnitude', it couldn't be found.

#### Rake

oops here you go:
C++:
float Magnitude(vec3_t vec)
{
return sqrtf(vec.x*vec.x + vec.y*vec.y + vec.z*vec.z);
}

#### Garang

##### Newbie
Can anyone help me the angle conversion formula for Unreal Engne based games?
I tried to find "View Angle Pointer Address" for Unreal Tournament 1999 and got the angles is not using degrees or radians. (The Yaw and Pitch is 4 bytes values, not a float).
The Yaw start from look forward then rotating up is 1 to 65555 (360 degrees), where "Look up" is stuck at 18000 and "Look down is stuck at 49000".
The Pitch, when rotate the mouse to the right, its start from 1 into 6555(360 degrees) then increase continously until 4294956884 then start into 1 again.(If rotate the mouse to the left its going into 1 and meet 4294956884 then decreasing continously)
what is the conversion formula for that angles based on the following Fleep's code? :

void CalcAngle(float *src, float *dst, float *angles) {
double delta[3] = { (src[0] - dst[0]), (src[1] - dst[1]), (src[2] - dst[2]) };
double hyp = sqrt(delta[0] * delta[0] + delta[1] * delta[1]);
angles[0] = (float)(asinf(delta[2] / hyp) * 57.295779513082f);
angles[1] = (float)(asinf(delta[1] / delta[0]) * 57.295779513082f);
angles[2] = 0;

if (delta[0] >= 0.0) {
angles[1] += 180.0f;
}

}

Also I want to ask what is the code to adjust aiming angle of certain Field of View (FOV)? (e.q. FOV 45 degrees aim only at the enemy infront of the player, not gonna rotate for enemy behind the player).
Sorry for my bad english and thank you for GuidedHacking.com.

Attention! Before you post:

99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

• Fill out the form correctly
• Tell us the game name & coding language