Trouble mapping back 3D model position to 2D screen position

My requirement is to make a screen Image icon always appear on the top of a model in 3D space. I understand I need to use worldToScreen method. And I believe it is giving me x and y pixel position. But when i setPosition or even setLocalPosition (I read in a forum that this uses pixels) it’s placing the icon far away in the screen.
I may have to do some weird translation to get it in the position I desire, after using the worldToScreen API, but I fail to understand how it’s supposed to be correctly done.

Below is the editor link

Is the screen icon an image element of the PlayCanvas UI system, HTML image or a 3D billboard plane?

(On my phone at the moment)

It’s a image element on a playcanvas UI system (2d screen)

You will need to implement worldToCanvas effectively. I’ve only done canvasToWorld here:

This post used my code as a base to do worldToCanvas: [SOLVED] Help Calculate Scale Ratio of Screen 2D

Hello, I would like to ask how to convert the world coordinates of an object into screen coordinates. I know the WroldtoScreen method may be used, but the value he returned to me is wrong

The WorldToScreen is pretty misleading in the sense that it doesn’t give you the screen co-ordinates that you can position your 2D Screen elements directly. I had to use the negative of the Y axis value and set my screen elements starting position on top Left for this to work.
And even with that you need to do some extra things if you have your “Screen Mode” as Blend.

19 AM56 AM![51 AM|690x46]

The second link in my post shows how another developer used the corners to work out the ratio difference to apply to the screen position to work on a UI screen.