Answers for "unity how to reference a script"

C#
2

reference to another script unity

SomeScript script = GetComponent<SomeScript>();
// alternatively, just make it a field:
[SerializeField] protected SomeScript script;
Posted by: Guest on April-20-2021
0

how to have referecne to script in unity

private GameObject player;
player.GetComponent<PlayerMovement>().enabled = false;
Posted by: Guest on September-03-2021

Code answers related to "unity how to reference a script"

C# Answers by Framework

Browse Popular Code Answers by Language