Hello,
Two days ago I have started to learn Godot game engine for programming I use C# because I'm more familiar with this language.
But about two hours ago I discovered a weird thing probably a bug that Return methods don't return updated value, but they always return the value that was given at a variable declaration.
I have a basic Node2D class, where is the method which is called every time you press a left click on the mouse, after a method call there is "numberOfSpawned++" which is incrementing that variable by one. After that there is print to console so you know that increment happened.
I want to know the value of this variable in different class, so in the first class I have created a public method which returns the current status of spawned objects (increment after every player click) but in the other class where I called the method it returns the value of 0 AKA the value which was given at the start of game.
Also these is something called: "Rozliseni" means Resolution
I have attached a picture with the code.
And also a link to the project.
I don't know If I'm dumb or what but I wasn't be able to find any solution.
So thank you very much for response with a solution!
And also excuse my english it's not perfect.
Project download: https://www.dropbox.com/s/2k4730zwr5mef9j/Csharp%20test.zip?dl=0
Picture: https://ctrlv.cz/4JYe