How I understood singletons and statics

I’m not really sure where to put this, but I hope this is fine. At first, i didn’t understand singletons or statics after watching the introduction video. so I watched the unity video recommended in the lecture after the intro. it confused me even more. so I turned on captions on the introduction video and watched it again while reading subtitles. I finally understood them! I think the instructors must have been talking to fast for me. if you have struggled with statics and singletons, try that!

1 Like

Hi Lincoln,

If you’ve not spotted it already, within the Udemy video player there is a playback speed option, you can both increase and decrease it, and by small steps so that it’s not ridiculously slow or fast (unless you want it to be obviously) - you might find this helpful.

It can also be useful when you are trying to keep up with the speed of entering code, saves having to keep pausing the video.

Hope this is of use :slight_smile:

1 Like

Hi zap6077,
I don’t understand at the beginning too. Here my process:
what video 65. About statics and singletons,
then video 66. Using statics variable,
then recommended video from Unity website,
then go back to video 65, then go back to Unity website. And I understand a little bit now.

When a first object is created, a variable of that object is also created. Then that object is created a second times, the variable is also created a second time. That variable will be created a long with the number of objects are created. and these variables are SEPARATE.

With static variable, the 2nd object can use the value of the variable of the 1st object. All objects were created will use the same variable. But when the 2nd object is created the 2nd static variable is also created. That’s why Ben destroy the 2nd music every time it is created in the lesson.

That’s what I though. If I am wrong, please correct me.

1 Like

Privacy & Terms