Last active
June 1, 2016 07:11
-
-
Save sirtawast/2ec8fe918ba78f6cf0f5 to your computer and use it in GitHub Desktop.
Cursor point raycasting in Unity3D
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
// Invert mouse y-axis and reduce taskbar height | |
Vector2 mousePos = Event.current.mousePosition; | |
mousePos.y = Screen.height - 35 - mousePos.y; | |
// Raycast | |
Ray ray = Camera.current.ScreenPointToRay(mousePos); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment