Answers for "unity how to add component through script"

C#
8

unity add component

//Use the AddComponent<T>() Method to add a component to your gameobject
GameObject gameObject;

gameObject.AddComponent<BoxCollider>(); //Component has to be an actual Unity component
Posted by: Guest on May-24-2020

Code answers related to "unity how to add component through script"

C# Answers by Framework

Browse Popular Code Answers by Language