Created
October 12, 2013 17:14
-
-
Save KevinJones/6952485 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
void Update() | |
{ | |
// attach to camera | |
if (Input.GetMouseButtonDown(0)) { | |
var ray = camera.ScreenPointToRay(Input.mousePosition); | |
RaycastHit hit; | |
if (Physics.Raycast(ray, out hit)) { | |
Vector3 v = hit.point; | |
// instantiate the "ping" transform at v | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment