Trouble with Inherited Model and its Transform

Godot Version

4.2.1

Question

Before I made and imported my own character model mesh and rig, I had a placeholder character scene:


Both characterbody scripts are the same, but I’ve updated it to try and fit the newer scene.
I need the script to be attached to a CharacterBody3D to access some of the inherited functions and fields. This worked perfectly in the placeholder scene where I am able to make the root node a CharacterBody3D. However, in the imported mesh character, I have the whole rig as a reference/inheritance to the import scene. This is so that I can easily change and reimport the rig if need be. The problem then is this: I can’t change the root node of the scene with the rig or else the inheritance breaks, and I can’t move the rig under the CharacterBody node because Godot won’t let me. So, when I transform the characterbody in script, the rig does not move along with it.
I’ve tried re-parenting the rig to the characterbody at runtime, but it seems like Godot prevents the parent change. Setting the rig’s transform to the characterbody’s transform works until I need to have the characterbody inherit another node’s transform, at which point the rig no longer moves with the characterbody.
Am I missing a solution to this? I’m a bit new to Godot so apologies if I’ve missed something obvious.

I’m am not really getting what you’re trying to do.

Why do you have a separate “Player” Node3 that holds the Character Body3D and a Mesh? Why don’t you instantiate the “Rig-Node” as the Child of the Character body? I don’t see why this would make any difference to re importing of the "Rig-Node.

Edit:
Or in my eyes even better just change the type of the “LFD rig” Node to CharacterBody3D

1 Like

Thanks very much for pointing this out! I looked again and it turns out I’m able to import the root node as a different type of node:

Or in my eyes even better just change the type of the “LFD rig” Node to CharacterBody3D

I can’t change the type of the inherited nodes nor move them in the heirarchy.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.