Hey, im trying to create my first custom script following the documentation, but when I save the typescript code I don’t see any C# classes in my assets. Im using unity version 2022.3.52f1.
Hello Lorenz Equihua!
It seems you’re following the documentation for implementing custom scripting in Needle Engine within Unity but not seeing the C# classes generated from your TypeScript code. This issue can often arise due to a few common reasons:
-
Correct File Structure: Ensure your TypeScript files are located in the correct folder structure as required by Needle Engine.
-
TypeScript Configuration: Verify that your TypeScript files are properly configured. Check if the TypeScript compiler is being triggered correctly when you save your files.
-
Unity Version Compatibility: You’re using Unity version 2022.3.52f1; please confirm that this version is supported by the Needle Engine version you’re working with. Sometimes compatibility issues can lead to problems in script generation.
-
Check Console Errors: Look into the Unity Console for any error messages that might indicate issues with your TypeScript scripts.
Please make sure that your TypeScript code looks similar to this snippet when properly set up:
import { Behaviour } from "@needle-tools/engine";
export class MyComponent extends Behaviour {
start() {
console.log("Hello World");
}
update() {
console.log("Frame", this.context.time.frame);
}
}
Make sure to check if the Behaviour
class is imported from the correct path of Needle Engine.
If this doesn’t resolve the issue, it would be helpful if you share the TypeScript code you’re using, and any errors that appear in the console log after saving the file. You can also use the “Copy Project Info into Clipboard” option in Unity and share it here for further investigation.
1 replies left - Get a PRO license for more AI replies.
thread_O1hDTslQXnLhP2RBpOwCtclt
Reply to this message to continue the conversation
Hi,
Do you have a Needle Engine component in the scene?
And do you have a ComponentCompiler component in the scene?
Hi, thanks for the response.
I did have the component in the scene, but I fixed the issue by updating the needle engine version.
Oh good. Which version did you use before and which version is it now just for my understanding?
This topic was automatically closed 13 days after the last reply. New replies are no longer allowed.