findobject getcomponent
GameObject.Find("Name of the object you want to access").GetComponent<Name of the Component (Transform,Script,RigidBody,etc..)();
An Example (easy to understand):
GameObject Player = GameObject.Find("Player");
PlayerController PlayerControllerScript = Player.GetComponent<PlayerController>();
PlayerControllerScript.run = true;
Another Example:
GameObject.Find("Player").GetComponent<PlayerController>().run = true;
rb = GetComponent<Rigidbody>();
Also in C#:
- while loop in c#
- c# count number of occurrences in string
- get variable from another script unity
- c# implement ienumerable t
- string to uint c#
- how to load the active scene unity
- unity how to rotate something to point to something else
- uinput dialog uwp c#
- Assets\playermove.cs(30,37): error CS1003: Syntax error, ',' expected
- entity framework update child records
- unity add sections to a list
- how to reference the position of a game object unity
- c# only letters
- how to convert iformfile to byte array c#
- c# pass mouse events to parent
- c# list tuple
- singleton design pattern c# volatile
- c# udpclient receive buffer size
- Execute code every x seconds with Update()
- c# make http request
- c# textbox tab column
- copy a list in c# unity
- Int64
- dynamic convert type c#