You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Duplicating a script that inherits from a custom resource, then attaching that script to an "instance" (not sure what to call it) of a resource causes the inspector to stop showing any exported variables from the resource. This only seems to happen when there is a difference in exported variables between the two sibling scripts but I'm not sure. The steps to reproduce should make it a lot clearer.
This happened to me when I was duplicating a script because I knew the next script would have similar code, so I think it's kinda common for this to happen. This was fixed by deleting the script, then making a new one without duplicating anything, and copy pasting manually.
I couldn't find any duplicates (haha) of this issue that specifically come from duplicating scripts, but it's possible that #83343 fixes this. I'm not sure though, since I don't have that version of Godot, nor do I know how to find that version of Godot.
Steps to reproduce
Create a new script test_resource.gd that extends Resource
Paste the following:
class_name TestResource
extends Resource
@export var member_variable: int
Create a new script inherited_resource.gd that extends TestResource
Paste the following
extends TestResource
@export inherited_member_variable: int
Create a new resource new_test_resource.tres. Select TestResource to be the "instancer" (still don't know what to call it)
Right-click then duplicate inherited_resource.gd. Name it inherited_resource2.gd
Replace the script body with the following:
extends TestResource
@export var duplicate_member_variable: int
Double click on new_test_resource.tres
Drag and drop inherited_resource2.gd to the script of new_test_resource in the inspector
Then drag and drop inherited_resource.gd to replace the duplicate
Watch all the variables in the inspector disappear! It should look like this:
Tested versions
Godot Engine v4.2.stable.official
System information
Godot v4.2.stable - Windows 10.0.22631 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Ti (NVIDIA; 31.0.15.4601) - AMD Ryzen 7 5700X 8-Core Processor (16 Threads)
Issue description
Duplicating a script that inherits from a custom resource, then attaching that script to an "instance" (not sure what to call it) of a resource causes the inspector to stop showing any exported variables from the resource. This only seems to happen when there is a difference in exported variables between the two sibling scripts but I'm not sure. The steps to reproduce should make it a lot clearer.
This happened to me when I was duplicating a script because I knew the next script would have similar code, so I think it's kinda common for this to happen. This was fixed by deleting the script, then making a new one without duplicating anything, and copy pasting manually.
I couldn't find any duplicates (haha) of this issue that specifically come from duplicating scripts, but it's possible that #83343 fixes this. I'm not sure though, since I don't have that version of Godot, nor do I know how to find that version of Godot.
Steps to reproduce
test_resource.gd
that extends Resourceinherited_resource.gd
that extends TestResourcenew_test_resource.tres
. Select TestResource to be the "instancer" (still don't know what to call it)inherited_resource.gd
. Name itinherited_resource2.gd
new_test_resource.tres
inherited_resource2.gd
to the script ofnew_test_resource
in the inspectorinherited_resource.gd
to replace the duplicateMinimal reproduction project (MRP)
resource_duplication_bug.zip
Inspecting the .tres file should show no exported variables after opening the project, since reloading the project did not fix this for me.
The text was updated successfully, but these errors were encountered: