[Godot 4.0] Editor Shows Error when using class_name on Script that Extends from Resource
Godot version
4.0.dev Beta 3
System information
Windows 10, foward_plus, Nvidia RTX 2060
Issue description
Editor displays message "Class Pepe(this case) hides a global script class", whenever saving a file with class_name.
In addition to this, when I create a resource based on this class and click to see it in the inspector, I cannot see the exported variables, even if I make a change it is not reflected in the inspector.
I am using Godot Editor

Steps to reproduce
Open attached project. Open my_script.gd. Save file There's an error.
Create a Resource using Pepe on Search box Double click on recent created Resource. Look at inspector, exported variable can't use from it. If I remove the class_name then all works fine

Minimal reproduction project
Related to https://github.com/godotengine/godot/issues/67056 (possible duplicate?).
I am having this same issue as well in Godot 4 beta 3
I recreated my simple project from a fresh start in Godot 4 beta 4. This issue seemed to disappear. Until I pushed a commit through github of the project. Then this error reappeared. Not entirely sure this is what caused it, but seemed to be the case. @arisvaldez was this the case with you as well?
I recreated my simple project from a fresh start in Godot 4 beta 4. This issue seemed to disappear. Until I pushed a commit through github of the project. Then this error reappeared. Not entirely sure this is what caused it, but seemed to be the case. @arisvaldez was this the case with you as well?
you Mean Godot 4 beta 3?
@Indieology In my case this error appears every time I use the keyword class_name in a file that inherits from Resource.
every time I give save then it produces the error.
I don't use any source code in this project
Related to #67056 (possible duplicate?).
Maybe it's the same, but in this case I added the behavior of the inspector, which happens when I try to open the resource file in Inspector
Hi everyone!!
@Indieology , @Calinou
I have tested the project in Godot 4 beta 6 and the error has disappeared
I can still see the error in Beta 14, any one else also having the issue? EDIT: I have a Node2D (not a Resource) that has a class_name of FooBar
I can still see the error in Beta 14, any one else also having the issue? EDIT: I have a Node2D (not a Resource) that has a class_name of FooBar
greetings @andersonmadeira , I tested on RC 2 and does not launch the error
I'm having this issue extending a Resource using class_name and get the Class Hides global script class error. In Godot 4.0.1. Just tried Godot 4.0.2, the issue is in the newest version as well. This happens when using the ResourceLoader when it pulls in the saved Resource. It seems to be loading the class_name twice (once from the save and once from the project) when it loads a saved Resource.
Further experimenting... This line: ResourceSaver.save(tmp_save, "user://save.tres", ResourceSaver.FLAG_BUNDLE_RESOURCES) causes the "hides global script class" error This line: ResourceSaver.save(tmp_save, "user://save.tres", ResourceSaver.FLAG_NONE) does not cause an error.
Why?
I also have a lot of trouble with this issue in Godot 4.0.2. It definitely is not dependent of the extended class, I get this with MeshInstance3D and others. Sometimes it helps to delete the .Godot folder to get the project running, but closing and reopening the editor raises the error again
Yep, having the same issue. Can we get this fixed please? It's really annoying and actually quite a critical bug to fix as it makes inheritance far less useful.
Is there a way to bump issues to gain more traction? This is pretty critical, in my opinion. Game development relies heavily on inheritance.
Same issue, only when I work on the project on a Mac.