migueldeicaza / SwiftGodot

New Godot bindings for Swift
https://migueldeicaza.github.io/SwiftGodotDocs/tutorials/swiftgodot-tutorials/
MIT License
985 stars 55 forks source link

Putting a wrong name in @BindNode does not produce an error message #490

Closed roydbt closed 1 month ago

roydbt commented 1 month ago

When I misspell a @BindNode variable's name and run the program, it crashes and produces no error message at all in the Godot debugger.

migueldeicaza commented 1 month ago

The reason is that this uses a non-optional type, so it forces a cast, any errors are not logged. There are other problems with BindNode that can not be fixed on Linux/Windows, so I recommend to use @SceneTree macro instead which is very similar, but produces an optional value