Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

touch screen to world point

  public void MoveAction(InputAction.CallbackContext context)
    {
        Vector2 touchPos = context.ReadValue<Vector2>();

        Ray ray = Camera.main.ScreenPointToRay(touchPos);

        Plane plane = new Plane(Vector3.up, transform.position);

        float distance = 0;

        if (plane.Raycast(ray, out distance))
        {
            Vector3 pos = ray.GetPoint(distance);

            Move(pos);
        }
    }
Comment

PREVIOUS NEXT
Code Example
Csharp :: ArgumentOutOfRangeException when sorting a DataGridView using a custom IComparer 
Csharp :: c# how to debig 
Csharp :: sliding window algorithm in c# 
Csharp :: c# Windows Forms screenshot 
Csharp :: create cursor in netezza 
Csharp :: c# check if username and password is true 
Csharp :: c# lambda get all records async 
Csharp :: gridview edit update delete in asp.net textbox size 
Csharp :: asp.net web hooks 
Csharp :: query to linq converter online 
Csharp :: visual studio private field underscore 
Csharp :: how to input data several times in c# 
Csharp :: how to check if every element in array is true c# 
Csharp :: unity follow object 
Csharp :: how to modigy login page asp.net core 
Csharp :: c# convert string to datetime any format 
Csharp :: how to backup terrain in unity 
Csharp :: Unity make a homing object 
Csharp :: spring jar debug level running 
Csharp :: csharp functions 
Csharp :: access autoload godot 
Csharp :: why process not found in c# 
Csharp :: tab key navigation C# winforms 
Csharp :: orderby make sunday last day c# 
Csharp :: how to declare two int variables in only one line c# 
Csharp :: changing color of material of renderer with multiple materias 
Csharp :: eleventy set default layout 
Csharp :: custom vscode snippet 
Csharp :: get sites ip in C# 
Csharp :: unity find disabled gameobject 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =