There is one object, it has a script with public values. There is another object, a script on it, which should take some variables from the first one and output them.
Now it looks like this
void Start() { AxisX = GameObject.FindGameObjectWithTag("Joystick").GetComponent<FloatSpeedXYJoystick>().AxisX; } private void OnGUI() { GUI.Label(new Rect(0, 0, 300, 30), "AxisX = " + AxisX.ToString("F3"); } It gets the values at the start, but they are zero. Probably, the fact is that he gets them once?
But to set the Update function with FindGameObject and GetComponent in the Update is very demanding.
What is a simpler solution to get changing values from a script of another object?