Answers for "disable gameobject script component unity"

C#
0

how to disable all other components in gameobject in unity

foreach (MonoBehaviour component in GetComponents<MonoBehaviour>())
{	
	if (component != this) component.enabled = false;
}
Posted by: Guest on May-20-2021

Code answers related to "disable gameobject script component unity"

C# Answers by Framework

Browse Popular Code Answers by Language