Answers for "unity2d click on gameobject"

C#
1

unity2d click on gameobject

// Object must have a collider and this script attached to the object
    private void OnMouseDown()
    {
        Debug.Log("Clicked on object!");
    }
Posted by: Guest on October-08-2021

C# Answers by Framework

Browse Popular Code Answers by Language