Hi, Im using the following code the pull a variable from another script, it seems to work fine.
But i now need to pull that variable every frame and I know using GameObject.Find is an absolute killer, how do i modify this script to make it more efficient?
Any help would be appreciated.
using UnityEngine;
using System.Collections;
public class timeregister : MonoBehaviour {
public float Alpha;
void Start()
{
Alpha = GameObject.Find("firstnumber").GetComponent<OnScreenControls>().Lion /100;
}
// Update is called once per frame
void Update () {
print (Alpha);
}
}