Using variables from different scripts in Void Update();

I can’t find any examples of how to use variables from other scripts in anything but Void Start(), is there any way to use it in update?

  1. Make the variable in the first script public.
  2. Reference in your second script the gameObject you attached the first script to.
  3. In your second script use this to get the variable: gameObjectName.GetComponent<ScriptClassName>().publicVariableName

Yes it’s possible. Make a float Timer and then when it reaches 0 do your function or your code.

Example :

public class Example : MonoBehaviour
        public float Timer = 3f;
        void Update()
                Timer -= Time.deltaTime;
                if (Timer <= 0)
                        // Your function or code here
                        Timer = 3f;