0 votes

when should i use _init function?
what is the difference with respect to ready?

in Engine by (182 points)

1 Answer

+2 votes

_init is more for class initialisation and it is called when the class is created, but _ready is called when the node is ready, that means when its children are ready.
You can find more information right here: https://docs.godotengine.org/en/stable/getting_started/workflow/best_practices/godot_notifications.html#ready-vs-enter-tree-vs-notification-parented

I hope I helped you.

by (81 points)

you can pretty much just use the _ready() function all the time.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.