Answers for "get mouse position unity"

C#
22

get mouse position unity

Vector3 worldPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
Posted by: Guest on July-16-2020
11

how to find the mouse position unity

Vector2 mousePosition = new Vector2(Input.mousePosition.x, Input.mousePosition.y);
Posted by: Guest on March-12-2020
0

How to get mouse position in unity

using UnityEngine;
using System.Collections;public class ExampleClass : MonoBehaviour
{
    void Update()
    {
        if (Input.GetButtonDown("Fire1"))
        {
            Vector3 mousePos = Input.mousePosition;
            {
                Debug.Log(mousePos.x);
                Debug.Log(mousePos.y);
            }
        }
    }
}
Posted by: Guest on June-22-2021

C# Answers by Framework

Browse Popular Code Answers by Language