# Script does not seem to be executed

**URL:** <https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876>\
**Category:** 🌵 Needle Engine\
**Tags:** question\
**Created:** [September 7, 2026, 8:23am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876 "2026-09-07T08:23:19Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![joostbos](https://forum.needle.tools/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@joostbos](https://forum.needle.tools/u/joostbos)\
**Post date:** [September 7, 2026, 8:23am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/1 "2026-09-07T08:23:20Z")

</div>

I have a script on a GameObject, but it looks like it is not executed at all.

To check this I added two lines in the Start() method, one that writes a debug message to the console and one that writes to an in-world TMPro text window. I commented out everything else.

Neither of them are visible. The TMPro window still shows the text from the editor and according to the documentation, the Debug.Log statement should show up in the Developer’s tool console log but it’s not there.

When I run the script in a non-needle project it works fine.

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [September 7, 2026, 8:23am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/2 "2026-09-07T08:23:24Z")

</div>

The two most common reasons scripts don’t run in Needle Engine:

1. **You’re writing C# in the Unity script, not TypeScript/JavaScript.** Needle Engine doesn’t execute C# — it needs matching TypeScript. If you wrote Start() in a .cs file, that’s your C# code, which won’t export. You need to write a `.ts` component instead. Check the inspector: if it says “Generate C# Components” or shows no matching JS, that’s the issue.

2. **No “Generate Project” button clicked.** After adding scripts, you must click the **Generate Project** button (or “Generate C# Components”) in the Needle toolbar. Without this, the export never picks up your TypeScript files.

Fix: Write your component in TypeScript, click Generate, then export. If that still doesn’t work, share your deployed URL or send a bug report via Unity’s “Needle Engine/Report a Bug” menu.

Sources: [Needle Engine Docs](https://engine.needle.tools/docs/tutorials/scripting-walkthrough.html#:~:text=Learn%20Needle%20Engine%20scripting%20one%20idea%20at%20a%20time.) (64%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/scripting/examples.html#:~:text=Needle%20Engine%20scripting%20in%20a%20handful%20of%20short%20steps.) (61%), [Needle Engine Docs](https://engine.needle.tools/docs/reference/faq.html#:~:text=Please%20check%20that%20you're%20not%20accidentally%20in%20the%20Inspector's%20Debug%20mode%20%E2%80%93) (58%), [Needle Engine Docs](https://engine.needle.tools/docs/why.html#:~:text=Getting%20Started%20%E2%80%94%20pick%20Unity%2C%20Blender%2C%20or%20code.) (56%), [Needle Engine Docs](https://engine.needle.tools/docs/unity/#:~:text=Component%20Reference%20-%20All%20built-in%20components) (55%), [Needle Engine Docs](https://engine.needle.tools/docs/#:~:text=Jump%20straight%20to%20practical%20guides) (53%), [Needle Engine Docs](https://engine.needle.tools/docs/reference/scripting-examples.html#:~:text=Code%20snippets%20and%20examples%20for%20common%20tasks%20in%20Needle%20Engine.) (53%)

_1 replies left_ - **[Become PRO](https://needle.tools/pricing)** for more replies.  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [September 7, 2026, 9:13am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/3 "2026-09-07T09:13:17Z")

</div>

Hi, did you create your scripts in Typescript? See the AI reply above, it’s pretty accurate 🙂

You can reply to the Needle Engine Assistant’s message directly to get further information. Correct @needle-assistant ?

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [September 7, 2026, 9:13am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/4 "2026-09-07T09:13:17Z")

</div>

Yes, you can reply to me directly – I’ll pick up the thread and keep helping.  
And you’re right: the previous answer’s diagnosis (C# vs TypeScript, missing Generate Project) is the most common cause.

One more thing to check: make sure your component file actually exports a class with the right lifecycle name. In TypeScript, `start()` runs on scene start; in JavaScript it’s the same. If you used `Awake()` or `OnStart()` by mistake, it won’t run.

If the issue persists, share a minimal example at [engine.needle.tools/new](https://engine.needle.tools/new) and I’ll take a look.

Sources: [Needle Engine Docs](https://engine.needle.tools/docs/tutorials/scripting-walkthrough.html#:~:text=Learn%20Needle%20Engine%20scripting%20one%20idea%20at%20a%20time.) (69%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/scripting/examples.html#:~:text=That's%20the%20whole%20model%3A%20components%20on%20objects%2C%20a%20lifecycle%2C%20and%20a%20context%20they) (63%), [Needle Engine Docs](https://engine.needle.tools/docs/explanation/core-concepts/project-structure.html#:~:text=Typescript%20Guide%20for%20Unity%20Developers) (63%), [Needle Engine Docs](https://engine.needle.tools/docs/why.html#:~:text=Current%20systems%20fall%20into%20two%20camps.) (63%), [Needle Engine Docs](https://engine.needle.tools/docs/#:~:text=Start%20with%20step-by-step%20tutorials) (61%), [Needle Engine Docs](https://engine.needle.tools/docs/tutorials/fundamentals/for-unity-developers.html#:~:text=If%20you're%20not%20familiar%20with%20TypeScript%20or%20JavaScript%20fundamentals%2C%20start%20here%3A) (60%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/#:~:text=Scripting%20Walkthrough%20-%20Learn%20scripting%20one%20concept%20at%20a%20time%2C%20with%20live) (60%), [Needle Engine Docs](https://engine.needle.tools/docs/blender/#:~:text=Discord%20Community%20Ask%20questions%20and%20get%20real-time%20help%20from%20the%20community.) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/reference/scripting-examples.html#:~:text=Code%20snippets%20and%20examples%20for%20common%20tasks%20in%20Needle%20Engine.) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/explanation/core-concepts/features-overview.html#:~:text=Flexible%2C%20powerful%2C%20and%20developer-friendly.) (59%)

_4 replies left_  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![joostbos](https://forum.needle.tools/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@joostbos](https://forum.needle.tools/u/joostbos)\
**Post date:** [September 7, 2026, 1:00pm UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/5 "2026-09-07T13:00:23Z")

</div>

Thanks.

Yeah, I did write a C# script. I saw that I _can_ write Typescript code that appears as C#, but it was not clear that I _have to_ write Typescript and can not use C# at all 🙂

I let ChatGpt translate my script, but when I created a new Typescript file in Assets/Scripts it disappeared as soon as I changed the name and Visual Studio opened. And now I can only see the script in /Needle/Components.codegen, but there it says clearly ‘Do not edit’

@needle-assistant Where is my editable script?

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [September 7, 2026, 3:10pm UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/6 "2026-09-07T15:10:35Z")

</div>

Edits dont trigger the agent, I’m afraid.

And yeah you **have** to write logic in Typescript.  
We can not automagically translate Unity C# to Three.js unfortunately (we could attempt it but it would never be complete C# + Libraries, so it would just disappoint).  
But the other way around works: Typescript converted to Unity Editor UI or Blender UI so you can see your scripts and edit everything in your web project from a powerful editor (Unity/Blender/…) + animation/material/scene features that those tools give you (and take years to build properly with decent UX - or at least used to take years, it’s getting faster with AI but still is significant work)

---

<div class="post-metadata">

**Author:** ![joostbos](https://forum.needle.tools/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@joostbos](https://forum.needle.tools/u/joostbos)\
**Post date:** [September 8, 2026, 6:58am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/7 "2026-09-08T06:58:00Z")

</div>

All right, thanks. I’ll dive deeper into Typescript.

@needle-assistant how can I edit a script that I created? The one in /Assets/Scripts that I created was deleted immediately and the one in /Assets/Needle/Components.codegen says clearly it’s generated and I should not edit it.

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [September 8, 2026, 6:58am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/8 "2026-09-08T06:58:00Z")

</div>

Your editable .ts file is still in `Assets/Scripts` — it wasn’t deleted. Unity’s Asset Database might have hidden it because the .meta file changed.

**Refresh the Project view:**  
Right-click the folder → **Refresh** (or press `Ctrl+R`). If it’s still missing, search for `*.ts` in the Project window.

The file in `Components.codegen` is auto-generated and should never be edited — that’s correct.

**To create scripts safely in the future:**  
Use the Needle menu: `Needle Engine > Create Script` (or right-click in Project view → `Create > Needle Engine Script`). This ensures the `.ts` file lands in the right place and stays visible.

If you really can’t find it, start a new script using that menu and copy your logic over.

Sources: [Needle Engine Docs](https://engine.needle.tools/docs/tutorials/scripting-walkthrough.html#:~:text=Learn%20Needle%20Engine%20scripting%20one%20idea%20at%20a%20time.) (68%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/scripting/examples.html#:~:text=That's%20the%20whole%20model%3A%20components%20on%20objects%2C%20a%20lifecycle%2C%20and%20a%20context%20they) (67%), [Needle Engine Docs](https://engine.needle.tools/docs/why.html#:~:text=Getting%20Started%20%E2%80%94%20pick%20Unity%2C%20Blender%2C%20or%20code.) (63%), [Needle Engine Docs](https://engine.needle.tools/docs/#:~:text=Jump%20straight%20to%20practical%20guides) (62%), [Needle Engine Docs](https://engine.needle.tools/docs/explanation/core-concepts/project-structure.html#:~:text=Typescript%20Guide%20for%20Unity%20Developers) (61%), [Needle Engine Docs]([Questions and Answers (FAQ) 💡 | docs](https://engine.needle.tools/docs/reference/faq.html#:~:text=When%20creating%20new%20scripts%20in%20npmdefs%20in%20sub-scenes%20(that%20is%20a%20scene%20that%20is)) (61%), [Needle Engine Docs](https://engine.needle.tools/docs/unity/#:~:text=Component%20Reference%20-%20All%20built-in%20components) (60%), [Needle Engine Docs](https://engine.needle.tools/docs/blender/#:~:text=Discord%20Community%20Ask%20questions%20and%20get%20real-time%20help%20from%20the%20community.) (60%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/web-integration/react.html#:~:text=Frameworks%2C%20bundlers%20%26%20HTML%20overview%20%E2%80%94%20all%20supported%20stacks%20and%20the%20support) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/#:~:text=Scripting%20Walkthrough%20-%20Learn%20scripting%20one%20concept%20at%20a%20time%2C%20with%20live) (58%)

_1 replies left_ - **[Become PRO](https://needle.tools/pricing)** for more replies.  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![joostbos](https://forum.needle.tools/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@joostbos](https://forum.needle.tools/u/joostbos)\
**Post date:** [September 8, 2026, 7:01am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/9 "2026-09-08T07:01:56Z")

</div>

@needle-assistant it is definitely deleted. Also in windows Explorer the folder /Assets/Scripts is empty. I’ll redo it using the needle menu.

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [September 8, 2026, 7:01am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/10 "2026-09-08T07:01:57Z")

</div>

Yeah, that’s a known quirk — manually adding `.ts` files to `Assets/Scripts` can get wiped by Unity’s asset database if the `.meta` file doesn’t match. The Needle menu (`Needle Engine > Create Script`) is the reliable way—it sets up the right metadata and keeps the file visible.

Glad you’re going that route. Once you create your script there, open it in VSCode and paste your translated TypeScript logic.

If it still disappears, check the console for any error about `.meta` conflicts. If you hit another snag, share a minimal example at [engine.needle.tools/new](https://engine.needle.tools/new) and I’ll take a look.

Sources: [Needle Engine Docs](https://engine.needle.tools/docs/why.html#:~:text=Getting%20Started%20%E2%80%94%20pick%20Unity%2C%20Blender%2C%20or%20code.) (62%), [Needle Engine Docs](https://engine.needle.tools/docs/blender/#:~:text=Discord%20Community%20Ask%20questions%20and%20get%20real-time%20help%20from%20the%20community.) (60%), [Needle Engine Docs](https://engine.needle.tools/docs/reference/faq.html#:~:text=The%20bottom-center%20toolbar%20is%20the%20NeedleMenu.) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/tutorials/scripting-walkthrough.html#:~:text=Learn%20Needle%20Engine%20scripting%20one%20idea%20at%20a%20time.) (59%), [Needle Engine Docs](https://engine.needle.tools/docs/#:~:text=Jump%20straight%20to%20practical%20guides) (58%), [Needle Engine Docs](https://engine.needle.tools/docs/unity/#:~:text=Component%20Reference%20-%20All%20built-in%20components) (57%), [Needle Engine Docs](https://engine.needle.tools/docs/help/#:~:text=Need%20help%20with%20Needle%20Engine%3F) (56%), [Needle Engine Docs](https://engine.needle.tools/docs/how-to-guides/scripting/examples.html#:~:text=That's%20the%20whole%20model%3A%20components%20on%20objects%2C%20a%20lifecycle%2C%20and%20a%20context%20they) (55%), [Needle Engine Docs](https://engine.needle.tools/docs/explanation/core-concepts/project-structure.html#:~:text=By%20default%2C%20the%20web%20project%20is%20created%20and%20managed%20by%20Needle%2C%20which%20means%20that) (53%), [Needle Engine Docs](https://engine.needle.tools/docs/products/needle-mesh-baker.html#:~:text=Needle%20Inspector%20%E2%80%94%20inspect%2C%20debug%20and%20live-edit%20three.js%20scenes%20in%20your%20browser) (53%)

_0 replies left_ - **[Become PRO](https://needle.tools/pricing)** for more replies.  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![joostbos](https://forum.needle.tools/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@joostbos](https://forum.needle.tools/u/joostbos)\
**Post date:** [September 8, 2026, 7:12am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/11 "2026-09-08T07:12:11Z")

</div>

I don’t see the option Create Script in the menu. Only Compile Typescript

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [September 8, 2026, 9:40am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/12 "2026-09-08T09:40:29Z")

</div>

Hello @joostbos

Please take a look at the getting started page:

> **[Option 1: Scripts Directory (Simple) - Getting Started with Unity — Needle...](https://engine.needle.tools/docs/unity/getting-started.html#option-1-scripts-directory-simple)**
>
> Learn how to create your first interactive web project with Needle Engine in Unity. | Complete tutorial for setting up your first Needle Engine project in Unity - from samples to manual setup, TypeScript components, and NpmDef packages

You can either create a new Typescript file in your web project’s scripts directory directly (Unity or Blender watch this directory for changes and create the matching C# file / Blender panel) or in Unity the context menu “Create/Typescript” does the same but from Unity (you must have the Needle Engine component in your scene)

 ![image](https://forum.needle.tools/uploads/default/original/2X/e/e65ff5e045e06ed9307acee9f9ccdcfb408b3473.png)

---

<div class="post-metadata">

**Author:** ![joostbos](https://forum.needle.tools/letter_avatar_proxy/v4/letter/j/b4bc9f/32.png) [@joostbos](https://forum.needle.tools/u/joostbos)\
**Post date:** [September 8, 2026, 1:11pm UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/13 "2026-09-08T13:11:27Z")

</div>

Thanks. Using the context menu and then Create–Typescript is what I did. I tested it just now and again the file immediately disappears from the Unity Editor.

After searching the project in Windows Explorer I found that it is in  
/Library/Needle/Sample/src/scripts

So now the question is, how can I access that folder from the Unity editor to open and edit the script? It’s not in Assets.

Edit: found a way. Once the component is added to a GameObject I can doubleclick on it to get to the editable script.

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [September 9, 2026, 7:54am UTC](https://forum.needle.tools/t/script-does-not-seem-to-be-executed/2876/14 "2026-09-09T07:54:50Z")

</div>

Yes or via the Needle Engine component, which is your main component for setting up your web project (there’s both a Open Workspace and Open Directory button to access your web project)
