hey, what am I missing? In my project none of the scripts have the open typescript button, for example the SceneSwitcher script. One image is from my project, the other one I took from another forum post.
It appears that the “Open TypeScript” button not being visible for your scripts may relate to how your Unity project is set up to generate TypeScript files. Here are a few things you can check:
Ensure you have NPM Definition Files: Make sure you have NPM Definition Files created in Unity. You can create them via Create > NPM Definition in the Unity context menu. After creating, add TypeScript files by right-clicking the NpmDef file and selecting Create > TypeScript.
Check Unity version compatibility: Ensure that you are using supported versions of Unity. The engine works best with specific versions, typically 2021.3 LTS or 2022.3 LTS.
Generate Components from TypeScript: Whenever you edit or add TypeScript files, make sure to regenerate your Unity components. There should be processes to do so within the NPM Definition structures you have set up.
Console/Editor Logs: Check for any error messages or warnings in the Unity console. They might provide hints if something is misconfigured.
If you still can’t find the button, could you please use the “Copy Project Info Into Clipboard” functionality within Unity and share that here? This will help in diagnosing the issue further.
Additionally, you might want to review the documentation for more insight on setting up scripts properly within your Unity project using Needle Engine (see scripting).
3 replies left thread_3fYqs5M1wtdwNalOV3z97I9e Reply to this message to continue the conversation
does your scene contain an ExportInfo component and is connected / pointing to a web project directory? Is the web project installed (e.g. does it contain a node_modules folder)
Below is a screenshot of my export component, there definitely is a web project installed.
However it looks like the compiler directory is pointing at a different project (see image), I assume that isn’t right? I did try and change it to the equivalent path in the “Zen Garden” directory but that didn’t seem to immediately fix the issue.
The component compiler path should be unrelated. As long as this directory exists and contains a valid version of the compiler it will work (this is however only responsible for generating the C# stub components, displaying the label is unrelated)
Which version of Unity are you using?
When you open the web project directory does the path exist: Needle/ZenGarden/node_modules/@needle-tools/engine/package.json ?
I’ve found something, it seems to be related to me having two inspector windows open at the same time. I think this is a reasonably common unity workflow as you can lock one inspector which is useful for copying/contrasting component data.
The Open Typescript button seems to only render in the older of the two inspector windows, I hadn’t been using the two inspector workflow for a while, but had a second inspector buried in one of my tabs.
So probably a lowish priority fix for you guys, it’s not a huge issue for me now I understand what it going on: