C-sharp component not being generated

After trying to save this logs

Generate codegen types: /Users/ivan/SirenaSnake/Assets/…/Library/Needle/CodeGen/Types.json
SourceFiles: 1800

Run codegen for Rotate.ts at /Users/ivan/SirenaSnake/Needle/Main/src/scripts/Rotate.ts
Command: node component-compiler.js “/Users/ivan/SirenaSnake/Assets/Needle/Components.codegen” “/Users/ivan/SirenaSnake/Needle/Main/src/scripts/Rotate.ts” in /Users/ivan/SirenaSnake/Library/PackageCache/com.needle.engine@2.55.0-pre/package~/node_modules/@needle-tools/needle-component-compiler/src

by user 353918275215818754


by user 353918275215818754


by user 353918275215818754

also i switch from 2022 version to 2021.3 as recommend on requirements

by user 353918275215818754

also wanted to mention that
my rotate.cs

// auto generated code - do not edit directly

#pragma warning disable

namespace Needle.Typescript.GeneratedComponents
    public partial class Rotate : UnityEngine.MonoBehaviour
        public float @speed = 1f;
        public float @money = 3f;
        public void start(){}
        public void update(){}


when rotate.ts is

import { Behaviour, serializable } from "@needle-tools/engine";

export class Rotate extends Behaviour
    speed : number = 1;
    money: number = 3;

        // logging this is useful for debugging in the browser. 
        // You can open the developer console (F12) to see what data your component contains

    // update will be called every frame
        this.gameObject.rotateY(this.context.time.deltaTime * 1);

it’s quite strange that update is empty

by user 353918275215818754

it’s after when i run command manually from terminal

by user 353918275215818754

also thanks for needle
it’s quite brilliant idea to bring unity to three js because wasm and unity webgl too slow

but i can’t use engine at all because custom scripting doesnt work🥲

by user 353918275215818754

It does work, you can use needle engine and the exporter, just auto compiling seems to have an issue from unity for some of you. I tried this on osx after it was reported but couldnt reproduce (the compiler worked as expected)

Im currently on holiday and will be back on the 30th to try to figure out why. You can manually create a c# component or invoke the script command manually that is logged in the console. Exporting components does still work.

Also all methods in csharp will always be empty because we don’t build the full csharp code, only components to hold the data for you to setup in unity and export (you can still implement them in c# if you want to of course)

You can read about it at Needle Engine Scripting | Needle Engine Documentation

oh, i see
everything working, okey
it’s quite interesting why auto exporter doenst work in mac os and windows (two different machines)
thanks for reply, now i can use command btw

by user 353918275215818754

By auto exporter you mean the compilation of js to csharp mock right?

Pinned a message.

yeah, i can generate c# files only with compile command, auto save doesnt work

by user 353918275215818754

Hey guys, could you try updating to the latest release and then try running the same command using the command tester window I added? You can open it via this menu item

and then enter the command you run manually with the correct paths like this and tell me what it says :slightly_smiling_face: (you can try both Run in Unity and Run External)

You can also try enabling “Debug” on the component and then re-save one of the scripts

I’m also having problems with the generator. I tried running the command in the command tester and I got zsh:1: command not found: node. Could it be related to the node path issue reported here? Discord

by user 401167615826984963

Yes that would be that issue. But does generating projects work? Do you use nvm?

@Weezle░ (らアザ) any chance you could try the above too once more? Im currently trying to reproduce / figure out why its not working for you guys.

yeah, i will try later today, thanks

by user 353918275215818754