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
When an exported category is created with @export_category, any object that shares the same name will always be Nil. A variable with the same name will work as expected if assigned after @export_category is called, but will crash if assigned before and referenced after.
Steps to reproduce
The following code will fail because Example is Nil.
extends Node
@export_category("Example")
func _ready() -> void:
var example_class: Example = Example.new()
print_debug(example_class.foo)
class Example extends Node:
var foo: String = "bar"
This seems to be reproducible with any object, including built-in objects like 'Input'. However, if the @export_category call is removed or altered so that the category name differs from the class name, then the code executes as expected. The two must match exactly, including case.
Minimal reproduction project
N\A: no project files required to reproduce.
The text was updated successfully, but these errors were encountered:
Godot version
4.0.stable
System information
MacOS 13.2.1
Issue description
When an exported category is created with
@export_category
, any object that shares the same name will always beNil
. A variable with the same name will work as expected if assigned after@export_category
is called, but will crash if assigned before and referenced after.Steps to reproduce
The following code will fail because
Example
isNil
.This seems to be reproducible with any object, including built-in objects like 'Input'. However, if the
@export_category
call is removed or altered so that the category name differs from the class name, then the code executes as expected. The two must match exactly, including case.Minimal reproduction project
N\A: no project files required to reproduce.
The text was updated successfully, but these errors were encountered: