c# unity gameObject.script

//define "myObject"
//(asign in in inspector)
public GameObject myObject;
//runs when you hit the play button
void Start()
{
  //change the name to "myObjectsNewName"
  myObject.name = "myObjectsNewName";
}
//Note for Unity and C#

3.75
8
Ryogi 75 points

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

  if (Thing == "String1")
  {
	DoStuff();
  }
  
    if (Thing == "String2")
  {
	DoOtherStuff();
  }
}

3.75 (8 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
gameobject in unity script gameobject unity c# unity gameobject create gameobject unity script write a gameobject unity c# unity gameobject code define gameobject in unity how to reference a gameobject in a unity script unity c# create gameobject what is gameobject in unity scriptobject unity as gameobject unity c# unity how to creat gameobject with script create a gameobject unity create a gameobject unity c# how to reference a gameobject in unity unity gameobject . unity how to get gameobject script how to reference gameobject in script unity create new gameobject unity c# public gameobject unity c# create gameobject unity c# how to get game oject with script in unity C# create gameobject unity unity as gameobject get gameobject with script unity create script on gameobject unity unity !gameobject get script gameobject unity gameobject script unity gameobject. unity what is the gameobject unity gameobject? unity unity gameObject documentation c# unity gameobject definition how to create gameobject in unity c# unity gameobject to script unity get script's gameobject how to create a gameobject in unity script gameobjects in unity gameobject gameobject unity unity 3d GameObject = gameobject declare gameobject unity c# this gameobject unity new gameobject unity unity new gameobject unity gameObject C# unity gameonject unity use gameobject in script unity get the gameobject of the script unity c# gameobject unity gameobject script unity this.gameobject unity script this gameobject unity gameobject class unity c# get gameobject of script unity object with gameobject this.gameobject unity unity this gameobject gameobject in unity 3d how to shadethe surronings of a gameobject unity unity game obj game object in a unity scipt gameobject unity script is script a gameobject unity open gameobject in script how do you find teh attributes of teh script of a gameobject in unity unity c# gameobject as class unity gameobject exaple c# gameobject unity c# this gameobject new gameobject unity c# unity GameObject() unity c# gameobject ndc get gameobject thata script is on, unity unity get gameobject of script game object = object = public GameObject unity game object unity c# unity gameObject.script untiy game object subscriptable object unity gameobject info unity game object methods unity how to set game object in unity unity set .gameObject unity gameobject library weber import game gameobject GameObject[] unity example gameobject class public gameobject function unity public gameobject unity docs game object gameobject class unity GameObject unity docs game object class unity get game object method unity gameobject calss in unity unity public gameobject documentation how to use gameobject in unity c# unity script gameobject how to script a game object unity unity class as game object unity get game object script gameobject isa gameobject c# unity public gameobject public gameobject unity unity gameobject document unity gameObject[] data members inside GameObject class in unity gameobject class script untiy gameobject Gameobject unity get gameobject in class make mpy game object a type unity difference between method and gameobject in unity gameobject using set up game object unity game object unity gameobject documentation unity gameobject gameObject datatype unity gameobject unity gameobject in unity c#
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source