Answers for "how to find a component in unity"

C#
1

how to find a component in unity

//Say you want to find a BoxCollider in the button, you would find the Gameobject first
//Then you would get the component of "BoxCollider" from "Button"

GameObject Button = GameObject.Find("Button");
BoxCollider button = Button.GetComponent<BoxCollider>();
Posted by: Guest on March-17-2021

Code answers related to "how to find a component in unity"

C# Answers by Framework

Browse Popular Code Answers by Language