My character has a sword that they can sheathe and move around with the sword in its' scabbard, or they can unsheathe the sword and hold it in their hand, using it to attack. How would you set up this in Godot? I've thought of several options, but I don't know if I'm trying to reinvent the wheel and there's an easier way to do it:

  1. Using BoneAttachment3D nodes: The sword would use a BoneAttachment3D that would switch the target bone between the hand bone and the scabbard bone when sheathing/unsheathing.
  2. Using different models and hiding the sword: The sword uses a BoneAttachment3D node to always remain in the hand of the character. The scabbard has a child mesh that is just the handle of the sword sticking out of the scabbard itself. When the sword is sheathed, the sword mesh becomes invisible and the handle mesh is made visible. When the sword is unsheathed it's made visible again and the handle mesh in the scabbard is hidden.

The sheathing and unsheathing animations are very quick, with the character twisting and crouching when sheathing, or turning and extending into a wide slash when unsheathing, so I will probably be able to get away with the animation not placing the sword right in the exact position inside the sheathe before making the switch in either method.

Which method works better in your experience? Is there another different (and better) way to do this?

    correojon Number 2. Always use cheats and fakes if you can get away with it. With fast animations there's always a lot of room for successful cheating 😃.

      correojon Which method works better in your experience? Is there another different (and better) way to do this?

      xyz Always use cheats and fakes if you can get away with it.

      Globally @xyz is definitely right — cheating and deception are a game developer's best friends. But there is a nuance here. Even a hidden mesh (sword in this case) continues to gobble up resources. If there are few such meshes, there is nothing to worry about. But if there will be a noticeable number of them (for example, clothing options) and several characters, it can cause noticeable slowdowns in the game. In this case it is better to consider not hiding but removing the node.

      And it also depends on the level of graphics — can the player even consider what exactly is being pulled out of the sheath and how?

        correojon look at how existing games do it.
        look at god of war, the axe hangs in the back. other games just have the weapon float over the character.

        for sheathing into a scabbard you need two models, one of the sword, and one of only the hilt.
        parent the sword to a boneattachment3D for the hand, parent the hilt and scabbard to a boneattachment3D for the pelvis or spine.
        at the point where the sword enters the scabbard in the animation, hide the sword, then show the hilt. when the hand reaches towards the hilt in the animation, hide the hilt and show the sword.
        it's that simple.

        the other way is to animate the weapon WITH the character, this is how GOW does it, it is not scalable and you can't use retargetting because the animation has to be tailored to the character.

          Tomcat The player will be the only one able to sheathe their sword and the whole game will be divided in small rooms with 6-7 enemies at most. The models are low-poly, so I guess that I'll be OK with just hiding the sword and there'll be no need to remove it. Thanks for the insight!

          Jesusemora In the end I decided to use a BoneAttachment for the sword, but for the scabbard I've just animated it with the character. I've done it this way because the scabbard doesn't just move with the character; In some poses it also changes inclination to get more energetic poses. I may end up animating the sword as well, because I'm already doing it in Blender to get a better feeling for the attack animations so it's just a matter of selecting it before exporting. These animations will only be used for the player, so there sould be no retargetting or scalability issues. Do you know of any other potential issues with this approach?