Jump to content

1 post in this topic

Recommended Posts

Posted (edited)

hello, so i am currently making a cheat for Pixel Gun3D and i'm making a ESP mod which uses Unity's WorldToScreenPoint function

		public Vector3 WorldToScreenPoint(Vector3 position)
		{
			Vector3 result;
			return result;
		}

i am using the one above and here is my code for calling it

Vector3 screenPos = WorldToScreenPoint(get_cam(), position);

the position is the enemy's position but then the worldtoscreen's return isnt accurate so i do this to get a better result

float xPos = screenPos.X- (SCREEN_WIDTH * 0.5); // SCREEN_WIDTH - (SCREEN_WIDTH - screenPos.X);
float yPos = SCREEN_WIDTH - screenPos.Y;

then draw it with ImGui:

ImVec2 startPoint = ImVec2((SCREEN_WIDTH / 2), 5);
ImVec2 endPoint = ImVec2(xPos, yPos);
ImGui::GetBackgroundDrawList()->AddLine(startPoint, endPoint, [self getImU32:Color::Black], 2.0f);

it still doesnt work like expected because it draws lines to places that are/arent near the enemy (picture below)

if anyone could help me to calculate the actual screen position i'd really apppreciate it

IMG_2834.png?ex=653f1dfd&is=652ca8fd&hm=

IMG_2833.png?ex=653f1f52&is=652caa52&hm=

Updated by YeetDisDude

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines