unity get script variable code example
Example: get variable from other scriptin unity c#
//-------------------------------PUT IN ScriptA-----------
public ScriptB = scriptB;
void Start()
{
scriptB.myFloat = 3.542f;
}
//---------------------------------------------
//---------------------------PUT IN ScriptB---------
//make sure public so it can be accessed from other scripts.
public float myFloat;
//script a will change myFloat to 3.542 from null;
//note this is for Unity and C#