Answers for "how to get a variable from another script c#"

C#
1

how to get a variable from another script c#

GameObject Button = GameObject.Find("Button");
button button = Button.GetComponent<button>();
//  ^ Name of script                 ^ Also name of script
button.Pressed = true
Posted by: Guest on June-22-2021

Code answers related to "how to get a variable from another script c#"

C# Answers by Framework

Browse Popular Code Answers by Language