[HELP] Screen2World

Is there anyway to get the position in world 3D from 2D cursor position

Exactly what do you mean by that?
Your cursor position moving freely on the screen? or on the map?

I want to convert the cursor position so X, Y to Vector3 X,Y,Z (3D World position) so i want to get where’s the cursor pointing in the world

IIRC, only NUI has the function to retrieve mouse position, so you’d have to look through there.
What is the purpose for this function though? What are you trying to make?

I want to make character selection for roleplay … selecting the character clicking on the ped… so right now i have the cam position and the ped creation but i need to conver the cursor position to 3DWorld coords to make calc with raycast if i’m clicking on the ped or not

You could use nui for that, make an invisible block infront of the ped, if it’s clicked, ped is chosen.

1 Like