Hi oot4chi, it sounds like your custom setting in needle.config.json (using “scriptsDirectory”: “src/lib/scripts”) might be causing Unity’s TypeScript creation to fail. The Needle Engine integration (for example, in the NeedleProjectConfig used by Unity at needle-engine-unity—NeedleProjectConfig.cs.txt) expects a valid directory for generated scripts. If you change the default path, the editor tool won’t create your TypeScript file unless that folder actually exists and is correctly resolved.
Here are a few steps to try:
• Make sure the folder “src/lib/scripts” exists in your Unity project. If it doesn’t, create it manually.
• Verify that needle.config.json is in the correct root directory so that the configuration is read correctly.
• As a quick test, consider reverting your scriptsDirectory to the default “src/scripts” to see if the TypeScript creation works. This helps determine if the issue is the custom path.
• Finally, check the Unity console for any error messages that might give more details about a missing directory or permission errors.
You can also use a simple Unity script to log whether the custom scripts folder is found. For example:
using UnityEngine;
using System.IO;
public class CheckScriptsDirectory : MonoBehaviour
{
void Start()
{
// Adjust the path relative to the project directory.
string projectDirectory = Application.dataPath + "/../";
string scriptsDir = Path.Combine(projectDirectory, "src/lib/scripts");
if (!Directory.Exists(scriptsDir))
{
Debug.LogError("Scripts directory not found: " + scriptsDir);
}
else
{
Debug.Log("Scripts directory located: " + scriptsDir);
}
}
}
Attach this script to a GameObject and run your project to verify that Unity can see the “src/lib/scripts” folder. If the log shows that the folder isn’t found, the TypeScript creation won’t work correctly.
If these steps don’t resolve the issue, please share additional project info (like Unity version and any error logs) so we can help further.
1 replies left - Become PRO for more replies. thread_4ooqv4vqgP8xNuHmED231Iev Reply to this post directly if you need further help (bottom right button)