Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

get object clicked unity 2d

RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, Vector2.zero);
if (hit.collider != null)
{
	Debug.Log("Clicked on Object!");
}
 
PREVIOUS NEXT
Tagged: #object #clicked #unity
ADD COMMENT
Topic
Name
7+5 =