How to get the Screen Position of a gameobject not on canvas


I want the direction arrow appear on top of the charactor.
I’m using the script below:
screenPosition = Camera.main.WorldToScreenPoint(charactorObj.transform.position);
charactorPositionOnScreen = new Vector2(screenPosition.x, screenPosition.y);
dragIndicatorRect.localPosition = new Vector3(charactorPositionOnScreen .x, charactorPositionOnScreen .y, dragIndicatorRect.localPosition.z);

I expect the charactorPositionOnScreen should be right on top of the charactorObj, but as you can see, it’s far away.
How can I set the canvas object (dragIndicatorRect) to appear on top of the charactor?