Answers for "unity float from another script"

C#
6

unity float from another script

public GameObject ScriptHolder;
public float Afloat;

//retrieve float every frame
void Update()
{
	Afloat = ScriptHolder.GetComponent<Script>().WantedFloat;
}
Posted by: Guest on January-21-2021
1

get float from others script

var class1 = GameObject.Find("MyObjectScript").GetComponent<MyClass1>();
    class1.myfloat = 3;
Posted by: Guest on January-04-2021

Code answers related to "unity float from another script"

C# Answers by Framework

Browse Popular Code Answers by Language