Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

Get Mouse World Position

public Vector3 worldPosition;

void Update()
{
    Plane plane = new Plane(Vector3.up, 0);

    float distance;
    Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
    if (plane.Raycast(ray, out distance))
    {
        worldPosition = ray.GetPoint(distance);
    }
}Copy
Comment

PREVIOUS NEXT
Code Example
Csharp :: devexpress spreadsheet document source wpf 
Csharp :: unity unhide object 
Csharp :: connect to a database and loop over a recordset in C# 
Csharp :: asp net c# browser cursor wait 
Csharp :: how to know pm or am C# 
Csharp :: c# integer part of float 
Csharp :: pricipal permission attribute in c# 
Csharp :: unity cannot click button 
Csharp :: referans tipi nedir c# 
Csharp :: structure in c sharp with example 
Csharp :: blazor image button 
Csharp :: #grid 
Csharp :: wpf StrokeDashArray 
Csharp :: c# streamreader to file 
Csharp :: Count the Number of Duplicate Characters 
Csharp :: Non-Serialized Fields in unity inspector 
Csharp :: c# webbrowser write html to text file 
Csharp :: display none asp.net 
Csharp :: string.insert c# 
Csharp :: c# how to make object rotate forever 
Csharp :: count number of specific characters in string c# 
Csharp :: ef core add OnModelCreating foreign key 
Csharp :: by value by reference c# 
Csharp :: get list of months and year between two dates c# 
Csharp :: delete all fields that start with mongo 
Csharp :: convert stream to base64 string c# 
Csharp :: google mobile ads app id 
Csharp :: dataannotations for currency in c# 
Csharp :: csharp-for-loop 
Csharp :: SceneManagment by BuildIndex 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =