Skip to content

Instantly share code, notes, and snippets.

@alufers
Last active August 29, 2015 14:02
Show Gist options
  • Save alufers/93da4c8c53a286612983 to your computer and use it in GitHub Desktop.
Save alufers/93da4c8c53a286612983 to your computer and use it in GitHub Desktop.
var hit : RaycastHit;
var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition);
if (Physics.Raycast (ray, hit, 10000))
{
Destroy(hit.transform.gameObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment