How to convert 3d position to 2d for canvas

Hi there!

I want to convert 3d position of game object to 2d anchor position for RectTransform in Canvas,

I tried to use WorldtoScreenPoint But it not work as I want, or I have to do something with screen.height/width?

So how to do it?

if I have gameObject in world 3d and Canvas for RectTransform that I want to point at gameObject in 3d world.

Thanks!!!