Created
January 13, 2018 00:53
-
-
Save brunomikoski/89385f8e4debf77a46f76729be7f1004 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vector2 movePos; | |
if (RectTransformUtility.ScreenPointToLocalPointInRectangle( | |
targetCanvas.transform as RectTransform, | |
Input.mousePosition, camera, | |
out movePos)) | |
{ | |
Vector3 mousePos = targetCanvas.transform.TransformPoint(movePos); | |
cursorRectTransform.position = mousePos; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment