Answers for "unity mouse position when click"

C#
26

unity get mouse position

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

unity mouse click m

void Update()
    {
        if (Input.GetMouseButtonDown(0))
            Debug.Log("Pressed primary button.");

        if (Input.GetMouseButtonDown(1))
            Debug.Log("Pressed secondary button.");

        if (Input.GetMouseButtonDown(2))
            Debug.Log("Pressed middle click.");
    }
Posted by: Guest on January-02-2022

Code answers related to "unity mouse position when click"

C# Answers by Framework

Browse Popular Code Answers by Language