So, I want to make a system where i want the values on my main script to change based on the values i get from another script. Something like this:
Script X:
Value : int;
OtherScript : ScriptY;
function awake ()
{
Value = null;
}
function start ()
{
OtherScript = gameObject.GetComponent(ScriptY)
}
function Update ()
{
if (OtherScript !=null)
{
Value = OtherScript.Number;
}
}
Script Y
var Number : int = 5;
Would something like this work?