-
Notifications
You must be signed in to change notification settings - Fork 87
-
today, i'm learning to use realtime database in firebase, godot. but there's an error like this "Invalid call. Nonexistent function 'get_database_reference' in base 'Nil'.". Anyone know how to solve this please help me
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 4 replies
-
You have to get the reference first. Sounds like you did not read the wiki. Please check the wiki for how to use the realtime database.
Beta Was this translation helpful? Give feedback.
All reactions
-
I just realized this page is written for 3.x. I'm not sure what version of Godot you're using. Let me know and if it's 4.x, I can update this page or make a new one accordingly: https://github.com/GodotNuts/GodotFirebase/wiki/Realtime-Database
Beta Was this translation helpful? Give feedback.
All reactions
-
thank you for reply, i forgot this on github :D
Beta Was this translation helpful? Give feedback.
All reactions
-
image
i am sure that i did every setup step by step, i filled all requirements in env file, set database rule to true, i gave up. Today i try it again but it make me disappointed again.
Beta Was this translation helpful? Give feedback.
All reactions
-
I see. The error you're getting is because it's made outside of ready. Declare it and set it this way:
var db_ref
func _ready():
db_ref = what you had before
Beta Was this translation helpful? Give feedback.
All reactions
-
Conversely, I believe you can declare the variable as you have it as onready and that should work.
Beta Was this translation helpful? Give feedback.