Question : unity float from another script
Answered by : eggspecialist
public GameObject ScriptHolder;
public float Afloat;
//retrieve float every frame
void Update()
{ Afloat = ScriptHolder.GetComponent<Script>().WantedFloat;
}
Source : | Last Update : Thu, 28 Jan 21
Question : get float from others script
Answered by : gal
var class1 = GameObject.Find("MyObjectScript").GetComponent<MyClass1>(); class1.myfloat = 3;
Source : | Last Update : Mon, 11 Jan 21