utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
562 stars 38 forks source link

Cannot add nor attach an existing Kotlin script to a node #565

Closed tomwyr closed 6 months ago

tomwyr commented 6 months ago

Attaching script to a node in an empty project results in errors as shown below: attach add

I also noticed that doing gradlew build logs this error in my terminal: ERROR: No loader found for resource: res://src/main/kotlin/com/example/game/Main.kt (expected type: Script) at: (core\io\resource_loader.cpp:282)

Using: Godot Kotlin 0.8.1-4.2.0 Godot Kotlin/Jvm plugin 0.8.1-4.2.0-IJ2023.2 IntelliJ IDEA CE 2023.3.2 Windows 11

Cthutq295 commented 6 months ago

You should attach ".gdj" files that are generated after you build your project with Intelij Idea and not ".kt"

tomwyr commented 6 months ago

Interesting I haven't used the Kotlin plugin for a while and missed the addition of registration files. The script now gets properly attached after referencing generated .gdj, as you suggested.