Godot Version
4.6.1
Question
Hello im a noob in godot. I'm trying to create a simple login system with database with SQLite plugin. I created database in a parent node and right now I'm trying to get access of it in child node
Parent:
Child:
When I’m trying to use variable db I get error “cannot call method on a null value”. So I printed it and yes it’s null.
I genuinely don’t know how to fix it. Pls help
Parent nodes only call _ready when all of their children are done with _ready, so the database is not created yet.
Make sure to paste code instead of screenshots
Posting here so to be linked for later use instead of re-typing this every time
Make sure you paste scripts instead of screenshots. To properly format pasted code use three ticks ``` at the start and end of your paste like so:
```
# type or paste code here
func _ready() -> void:
print("My ready function!")
```
Results in:
# type or paste code here
func _ready() -> void:
print("My ready function!")
Press the </> button or ctrl+e in the forum to create these ticks.
[2024-09-02…
1 Like