![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Covenauta |
I asked about it a long time ago, but I didn’t receive any answer, in that time I went back to the last project version and continue, actually it has happened again so I will try to ask it with new information
Last question: my first question
I have a class “Data_Plantas” typed as “P” where I save the plants data in enums and constants
I try to export an enum of “P” in a different node, and that line is not flagged as an error, but I realize that popped up this in the console every time I write “expo”
When I run the game, it stops
Then I write on ready the same enum of “P”

It stops but gives us a different error, in the last line of the same code

It was working in that exact way, but suddenly on run, it don’t, I wasn’t doing any change in “P” or the export.
Oh man where to start without writing an encyclopedia…
will try to simplify
Don’t use classes like this unless its in Global Space (Like an Autoload in Godot)
If you use many enums centralize them in one file since this isn’t c++
And that file must only contain enums
Wakatta | 2022-09-20 23:47
Okay, it’s right, saving this in a global script is a better idea than using typed classes. I will move all of them.
Covenauta | 2022-09-21 17:51
Now “Data_Planta” is a Global script, it works in code, but not in export
Covenauta | 2022-09-21 18:38
Very strange indeed
make sure the Autoload name is what you’re using
and remove any redundancies like class_name P
Wakatta | 2022-09-21 19:11
Yes, I am sure, you can see that the name is “P”; on the button left; is the same code and the editor flagged class_name, so I removed it. maybe it’s something wrong with the file’s project. if is necesarry I would re-build it in a new project, but I want to try a few things, thanks to give some help, I would never use a typed class for it again xD
Covenauta | 2022-09-21 19:49