global variables

hello! I’m new to Blender, so I’m completely lost, I don’t even know if this thread is in the right place, any other awkward disclaimers you can possibly imagine~ but I’d really appreciate whatever help I can get!

I’ve spent a week trying to teach myself the basics. I have a very simple game. walk around as a cube, push things to make sound effects, go through doors to move between scene A and scene B. now I just want to know that I can do global variables. make them, change them, use them to affect the game.

so my goal is this: make a global variable that equals 0. press spacebar in scene A to change the global variable from 0 to 1. then press spacebar in scene B while global variable equals 1 to make a sound effect, or destroy a cube or whatever. just a simple test so I understand what’s going on.

but this is my first time with code so I don’t even know where to start. finding the text editor is as far as I got. can anyone point me in the right direction, or give me something to copy and paste, or whatever?

edit: I’m just now realizing that I should probably work with properties somehow? like change a property so it has the same value as the global variable? but I still don’t know how to do that.

My advice is “patience”.

I am not betting that anyone is going to fix your problem overnight.

From reading your post, I understand that you are new to Blender, you want to create a game, and you believe that you need to learn coding in order to finish creating this game.

In order for me to give you any advice I would like to ask some questions, if you do not mind.

  1. Are you studying any particular tutorial?

  2. If so, can you provide a link to any tutorials you have studied and are having problems with?

  3. Have you tried any of the resources on blender.org?

  4. What got you started with Blender?