Answers for "unity get the gameobject of the script"

C#
1

unity get script from gameobject

obj.GetComponent<Script>();
Posted by: Guest on April-08-2021
1

c# unity gameObject.script

void Update()
{
  string Thing = gameObject.GetComponent<CustomScriptName>().Variable;

  if (Thing == "String1")
  {
	DoStuff();
  }
  
    if (Thing == "String2")
  {
	DoOtherStuff();
  }
}
Posted by: Guest on December-22-2020

Code answers related to "unity get the gameobject of the script"

C# Answers by Framework

Browse Popular Code Answers by Language