[Solved] How do you get screen coords from world coords?

Hi, I’ve been trying to get the screen coordinates for an entity or a world coordinate. I’ve tried using the
“GetScreenCoordFromWorldCoord”, and it seems to work sometimes, but i often get this error:

SCRIPT ERROR: @script/client.lua:5: attemp to call a nil value (global 'GetScreenCoordFromWorldCoord')

My code:

Citizen.CreateThread(function()
    Citizen.Wait(1000)
    local player = GetPlayerPed(-1)
    local playerCoords = GetEntityCoords(player)
    GetScreenCoordFromWorldCoord(
        playerCoords.x --[[ number ]], 
        playerCoords.y --[[ number ]], 
        playerCoords.z --[[ number ]]
    )
end)

Wondering if it could be cause of this:

If anyone has a solution, please let me know. :slight_smile:

Are you using the latest resource manifest?

That seemed to do the trick! Thank god, and thank you!

1 Like