Answers for "mouse click in new input unity"

C#
5

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

C# Answers by Framework

Browse Popular Code Answers by Language