Open rcorre opened 1 year ago
In 4.3.stable.arch_linux this also seems to be able to manifest as
Script inherits from native type ‘CharacterBody3D’, so it can’t be assigned to an object of type: ‘Node3D’
A workaround seems to be to set the Root Type in the import as CharacterBody3D
and attach the Child
script manually.
Also, annoyingly, if the initial hierarchy is CharacterBody3D > Child
and Base
is added later, the error seems to only appear after a reimport, meaning that a fresh clone of the project repository will show the error, while existing working copies remain unaffected.
Confirmed this is still an issue on both latest stable (v4.3.stable.official [77dcf97d8]) and dev-snapshot (v4.4.dev3.official [f4af8201b]). Did a little digging and found that the error seems to come from:
String root_type = p_options["nodes/root_type"]; if (!root_type.is_empty()) { root_type = root_type.split(" ")[0]; // Full root_type is "ClassName (filename.gd)" for a script global class. Ref Githubissues.
Githubissues is a development platform for aggregating issues.
Godot version
4.0.2.stable.arch_linux
System information
Linux
Issue description
If you have a chain of inherited classes, e.g.
CharacterBody3D > Base > Child
, you cannot set the Root Type of an imported scene toChild
.Steps to reproduce
class_name Base
that extendsCharacterBody3D
class_name Child
that extendsBase
.blend
file to the projectMinimal reproduction project
example.zip