Unity Script Not Running? Why Update or Start Isn’t Being Called

Illustration: a gear icon frozen in place with a question mark beside a sleeping code file

You wrote a script, there are no errors, you press Play, and nothing happens. No movement, no log, no reaction. When a Unity script is not running, the code is usually fine and the problem is how it’s attached, named or enabled. This guide is a checklist that finds the cause in a couple of minutes, starting with a one-line test that tells you whether Unity is calling your code at all.

First: Prove Whether the Code Runs

Add a log at the top of the method you expect to run:

void Start()
{
    Debug.Log($"{name}: Start ran", this);
}

void Update()
{
    Debug.Log($"{name}: Update ran", this);
}

Passing this as the second argument means clicking the log in the Console highlights the object that wrote it. Now press Play:

  • No logs at all: Unity isn’t calling your methods. Work through the attached, enabled, name and compile sections below.
  • Logs appear: the method runs, so the logic inside is wrong or something else undoes it. Jump to the order section.

Check the Console’s info filter (the white speech bubble icon) is on, or you won’t see Debug.Log messages. For more powerful debugging, use breakpoints; the debugging guide shows how.

Is the Script Attached to an Object in the Scene?

A MonoBehaviour script in the Project window does nothing on its own. Unity only calls Start and Update on components, which are scripts added to GameObjects in a loaded scene.

  • Select the object you think has the script and look for it in the Inspector.
  • Search the Hierarchy with t:YourScriptName to list every object that has it.
  • If it’s on a prefab, make sure an instance of that prefab is in the scene or gets spawned. Editing the prefab asset alone doesn’t put it in the game.
  • If you have several scenes, make sure the object is in the scene you’re actually playing.

If the Inspector shows “The associated script can not be loaded” or “Missing (Mono Script)”, the component lost its link to the file. The missing script guide fixes that, and if you couldn’t add the script at all, see the class name mismatch guide.

Component and GameObject Enabled

Unity doesn’t call Update on disabled components or on components of inactive GameObjects.

  • Component checkbox. The tick next to the script name in the Inspector must be on. If there’s no tickbox at all, the script has no Unity messages like Start or Update, which is a clue your method names are wrong.
  • GameObject active. The checkbox at the top of the Inspector must be on, and every parent must be active too. A greyed name in the Hierarchy means the object is inactive in the hierarchy.
  • Something disables it at runtime. Another script may call SetActive(false) or enabled = false. Watch the Inspector during Play Mode to see if the tick changes.

Note that Awake runs on an enabled-or-disabled component as long as the GameObject is active, while Start and Update require the component to be enabled too. The Awake vs Start guide explains the full order.

Method Name and Signature Typos

Unity finds messages like Update by exact name. There’s no compile error for a typo, Unity just never calls it. These all silently fail:

void update() { }                        // lowercase u
void Updete() { }                        // typo
void OnTriggerEnter(Collider2D other) { } // 3D name, 2D parameter
void OnCollisionEnter(Collider other) { } // should be Collision, not Collider
void OnTriggerEnter2d(Collider2D other) { } // lowercase d
void Start(int x) { }                    // Start takes no parameters

Your IDE helps: with Unity support installed, Visual Studio, Rider and VS Code (with the Unity extension) colour or mark Unity message methods, and typos stand out. If your IDE doesn’t, the IntelliSense fix sorts it out.

Access modifiers don’t matter: private void Update() and void Update() both work.

Compile Errors and Stale Code

If any script in the project has a compile error, Unity keeps running the last version that compiled. Your new code isn’t there yet. Look for red errors in the Console. Unity also refuses to enter Play Mode in this state.

Other stale code causes:

  • Unsaved file. Save in your IDE. Unity reads from disk.
  • Auto Refresh off. In Preferences > Asset Pipeline, if Auto Refresh is disabled, press Ctrl+R to make Unity notice changes.
  • Enter Play Mode Options. With domain reload disabled, static variables keep values from the last play session. Code runs, but with old state. Reset statics in a method marked [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)].

timeScale and Paused Time

If Update runs but movement doesn’t, check Time.timeScale. A pause menu that set it to 0 and never set it back freezes anything using Time.deltaTime, and FixedUpdate stops entirely. Log Time.timeScale to check.

A common case: you paused, loaded a new scene from the pause menu, and timeScale stayed 0 because it’s global and survives scene loads. Reset it to 1 when loading a scene. The pause menu guide covers this trap.

Runs but Too Early, Too Late or Overwritten

If your log fires but the result isn’t visible:

  • Another script overwrites it. Two scripts setting the same position or velocity: the last one wins. Search the project for the property you’re setting.
  • Animator overrides transforms. An Animator with clips that animate position, rotation or scale will overwrite what your script sets. Move the object with a parent, or remove those curves.
  • Wrong reference. You’re changing a prefab asset instead of the instance in the scene, or a different object with the same name. Log the object with Debug.Log(target, target) and click it.
  • Exceptions stop the method. A NullReferenceException halfway through Update stops the rest of that method every frame. Check the Console for red runtime errors. The NullReferenceException guide helps.
  • Coroutine never started or stopped. Coroutines stop when the GameObject is deactivated. Starting one on an inactive object throws an error.

📚 Understand Unity’s lifecycle

Many “script not running” problems disappear once the event order clicks. Our list of the best books for game developers includes beginner-friendly Unity C# titles.

Troubleshooting

Update not called but Start is

Something disables the component or GameObject after Start, or timeScale is 0 and you’re judging by movement. Log inside Update to confirm.

Start not called on a script added at runtime

Start runs before the next Update of that component, not immediately after AddComponent. Awake and OnEnable run immediately.

FixedUpdate not running

timeScale is 0. FixedUpdate doesn’t run at all while time is stopped.

Script works in one scene but not another

The object in the second scene doesn’t have the component, or a reference assigned in the Inspector is empty there.

No tick box next to the script in the Inspector

The script contains no Unity message methods Unity recognises, like Start, Update or OnEnable. Check spelling.

FAQ

Does a script need to inherit MonoBehaviour to run?

To receive Start and Update from Unity, yes, and it must be attached to an active GameObject. Plain C# classes only run when other code calls them.

Do private Update methods work?

Yes. Unity calls message methods regardless of access modifier.

Why does my script only run once?

You put the code in Start or Awake, which run once. Per-frame logic belongs in Update.

Can a ScriptableObject have Update?

No. ScriptableObjects don’t get Update calls. Drive them from a MonoBehaviour.

How do I see which objects have my script?

Type t:ScriptName into the Hierarchy search box.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *