Answers for "unity access other scripts"

C#
1

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
1

how to reference scripts in other scenes unity

//you can use this to preserve scripts when loading new scene
DontDestroyOnLoad();
Posted by: Guest on May-10-2020

Code answers related to "unity access other scripts"

C# Answers by Framework

Browse Popular Code Answers by Language