Hello,
i have a script which needs to know the mouseposition on the rectangle it is assigned to.
so i have here:
Vector2 localCursor;
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle (newmap.GetComponent<RectTransform> (), Input.mousePosition, go.maincamera, out localCursor)) {
}
mousedebug.transform.localPosition = localCursor;
While this seems to follow the mouse there are some issues:
Sometimes it seems to ignore the position in “stripes” and when i move out of the “stripe” the mousedebug prefab jumps.
Also it seems to be not on the mouse but above it or beside it.