get camera x,y,z position

DutchGay101

Active member
Joined
Sep 15, 2023
Messages
27
Reaction score
2
how do i get the player camera's x,y,z position ?
i tried
float camX = (float)(0x76F338);
float camY = (float)(0x76F33C);
float camZ = (float)(0x76F340);
didnt work
 

SIGKILL

Active member
Joined
Apr 29, 2020
Messages
38
Reaction score
23
Location
Earth
It doesn't work because you are essentially casting hex values (they are just integers) into floating point values. What you want to do is treat the hex values as memory addresses and read the value at the address like this:

C++:
float camX = *(float*)0x76F338;
float camY = *(float*)0x76F33C;
float camZ = *(float*)0x76F340;

Also, be sure your code is in the same memory space as the game (like a DLL that is hooked into the game process) otherwise you can not read this memory like described above.
 
Top