Updating localPosition using parents' position

Currently I have this piece of code that update the position of a sprite on the screen when I drag it with the mouse. I want another object (the arrow) to follow it exactly at one specific point (the feet of the sprite, the middle of the bottom border of the collider), but this script doesnt work in fullscreen mode as it does in window mode because of differing scales ( I think ). So in order to get it working I need to use to localPosition I suppose, but I have no idea what to do here.

As you can see , I’ve set the offset in the arrow position to 60f but this isnt relative to screen size it seems.

	void OnMouseDown()
		screenPoint = Camera.main.WorldToScreenPoint(gameObject.transform.position);
		offset = gameObject.transform.position - Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
	void OnMouseDrag()
		Vector3 curScreenPoint = new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z);
		Vector3 curPosition = Camera.main.ScreenToWorldPoint(curScreenPoint) + offset;
		Vector3 curArrowToScreenPoint = new Vector3(curPosition.x, curPosition.y**-60f**,screenPoint.z);
		Vector3 curArrowPosition = Camera.main.ScreenToWorldPoint(curArrowToScreenPoint)+ offset;
			transform.position = curPosition;
			arrow.transform.position = curArrowPosition;


Make the arrow a child of the sprite, position it exactly where you want and move only the sprite from your script. The arrow will stay at the same position relative to the sprite, i.e. it will move along with it the way you want.

why don’t you change line 17 like this:

arrow.transform.position = transform.position + new Vector3(0, -1, 0);

and instead of -1 put the number you need. should work in all the resolutions.