question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Future of GodotOnReady in Godot 4.0+?

See original GitHub issue

I believe Godot 4.0 now lets you [Export] public Node n;. Providing [OnReadyGet] public Node n; is the main reason I wrote this library, so I’m thinking it might now be obsolete.

https://godotengine.org/article/dev-snapshot-godot-4-0-alpha-11 Exporting Node pointers as NodePaths (@export var some_node: Node)

I’ve still got to get my hands on the 4.0 beta to confirm that works how I expect, and see if there’s other feature gaps I’m forgetting that I want to use GodotOnReady to plug. GodotOnReady has evolved to support more cases (like defining a default NodePath in the attribute that can be overridden in the editor) but personally I’m not sure if those would justify using the library in my own projects.

Now that Godot has built-in source generators and analyzers, ideally any new features can be added to Godot directly through a proposal rather than a library like GodotOnReady.

Opening this issue for comments in case anyone else has some thoughts. 🙂

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
cphillips83commented, Jan 6, 2023

Just a side note to the _Ready issue, my workaround was instead of doing an override of _Ready, I created a ctor for the class and hooked to TreeEntered to execute my own source gen/node wire up logic.

I ended up using TreeEntered instead of Ready because _Ready is called before the event Ready is fired and I wanted to make sure that if I had custom logic in _Ready that the nodes would be gathered already.

1reaction
31commented, Dec 17, 2022

I guess it’s not a big deal–here’s what I came up with a little later, which I think I’d actually be happy with:

[OnReadyGet(In = "my/node/somewhere")] private Node deep;
[OnReadyGet(Unique = true)] private Node myNodeSomewhereDeep;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Godot 4.0 sets sail: All aboard for new horizons
Godot 4.0 is the culmination of years of your time and effort. ... maintain for the foreseeable future to enable existing Godot 3...
Read more >
Add OnReady annotation to C# · Issue #2425
The way I fixed this in GodotOnReady (without changing the Godot Engine source ... neikeq added this to the 4.0 milestone on Feb...
Read more >
Godot Onready var not working and getting error ...
I fixed this issue by putting a "@" in front of onready . @onready var raycast = $RayCast3D.
Read more >
Should I wait for 4.0? : r/godot
I have spent a good couple of months working on my game in Godot 3 (3D). ... more into how porting your project...
Read more >
GodotOnReady 1.2.4
GodotOnReady is a C# Source Generator that adds convenient onready-like features to your C# scripts in Godot Mono without any reflection.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found