Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get object clicked unity 2d

RaycastHit2D hit = Physics2D.Raycast(Input.mousePosition, Vector2.zero);
if (hit.collider != null)
{
	Debug.Log("Clicked on Object!");
}
Comment

unity click on 2d object

// Requires for the object to have a collider and this script attached
private void OnMouseDown()
{
	Debug.Log("Clicked on object!");
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: new Color from hex in unity 
Csharp :: c# how to delete a file 
Csharp :: unity c# get bool from another script 
Csharp :: setactive unity 
Csharp :: c# how to get screen resolution in class 
Csharp :: how to change particle system rate over time unity 
Csharp :: c# reverse list 
Csharp :: remove all non number in c# 
Csharp :: c# absolute value 
Csharp :: c# try catch with error message 
Csharp :: c# format decimal as currency 
Csharp :: c# get wifi ip address 
Csharp :: load scene unity 
Csharp :: c# press key 
Csharp :: c# counting lines 
Csharp :: if get key down unity 
Csharp :: untiy delet ke 
Csharp :: c# declare empty string array 
Csharp :: mvc select list order by 
Csharp :: Base64String to stream c# 
Csharp :: unity vector3.distance giving nonsensical values 
Csharp :: how to copy a file in c# 
Csharp :: unity object walkable not working 
Csharp :: unity agent walks in place at start 
Csharp :: c# process start 
Csharp :: c#image to bytes 
Csharp :: clear array c# 
Csharp :: remove all letters from string c# 
Csharp :: how create another new app file in laravel 
Csharp :: unity dontdestroyonload 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =