Can anybody explain how Life Cycle & Reference Counting works in Gdscript ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Harshvardhan

i am new at programming , so please explain as i am dumb .

I’m curious why you’re asking? If it’s just for pure knowledge, I get it. However, if you’re new to programming (as you say), there are likely more important places to focus your efforts. Especially in Godot, where you (generally) don’t have to worry about such details…

jgodfrey | 2022-03-11 21:12

Basically i am currently following a gdscript series through youtube . BUT the instructor provide wrong information about this topic . Check the video discription and pinned comment of that video , you will get what i am saying …

video link :-

So as for the sense of fullfillment of the series i am asking this question, yaa i know its not that important for beginner.

Harshvardhan | 2022-03-12 04:36

:bust_in_silhouette: Reply From: ponponyaya

Take a look at this video.
By the way, the creator of above video has a great series tutorial videos about GDScript.

yes , i know about it even i am currently following this same series… but in the video about
Life Cycle & Reference Counting, he provided wrong information … please check the video description and pinnned comment , you will get what i am saying … THANKS

Harshvardhan | 2022-03-12 04:42

Ok, I got it. The problem is hard for new programmer(I am a new programmer too). But in the other hand, I think no matter what is the variable’s lifecycle, we only need to deal with those Object variables(use queue_free() or free()) manully, and Godot will automatically deal with other varibles for us, for example build-in types(int, String, Array, etc…), Reference or Resource.

ponponyaya | 2022-03-12 08:24