Skip to content

Instantly share code, notes, and snippets.

@KevinJones
Created October 12, 2013 17:14
Show Gist options
  • Save KevinJones/6952485 to your computer and use it in GitHub Desktop.
Save KevinJones/6952485 to your computer and use it in GitHub Desktop.
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