Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Raycasting to find mouseclick on Object in unity 2d games

RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);

if(hit.collider != null)
{
    Debug.Log ("Target Position: " + hit.collider.gameObject.transform.position);
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: wpf how to focus on element 
Csharp :: how read excel data in c# 
Csharp :: carousel asp.net mvc beginner 
Csharp :: how to trim path in C# 
Csharp :: unity getcomponent 
Csharp :: c# make file not read only 
Csharp :: how to use curl in asp.net c# 
Csharp :: check file lock c# 
Csharp :: c# show list in richtextbox 
Csharp :: iterate though data in firebase unity 
Csharp :: c# remove everything after last slash 
Csharp :: enable cors asp.net mvc 
Csharp :: npm add auth token 
Csharp :: c# inheritance 
Csharp :: class in c# 
Csharp :: how to convert timestamp to datetime c# 
Csharp :: fluent api 
Csharp :: c# list foreach lambda multiple actions 
Csharp :: remove duplicates in the list using linq 
Csharp :: combobox in datagrid wpf 
Csharp :: c# array.reduce 
Csharp :: c# array zaheln speichern 
Csharp :: c# find comma in text and remove 
Csharp :: C# Calculate MD5 Checksum For A File 
Csharp :: how to customize xunit input 
Csharp :: verifyusertokenasync password reset token 
Csharp :: c# object is enum 
Csharp :: c# progress bar timer 
Csharp :: Ignore case string linq c# 
Csharp :: unity hide mouse first person 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =