• Godot Help
  • How to attach a gun to a hand bone in blender?

Is there a way of doing this? I’ve spent days trying to figure out how to attach a weapon to have a hand model and import it, but only armature deform works and that warps the gun.

  • Bone and object constraints (child of, copy transform) don’t work at all as gltf doesn’t export it or Godot ignores it.
  • bone parenting seems to almost work and even imports as a boneattachment, but it’s offset badly in Godot and requires each gun to have its own bone and armature, which is clunky.

Is there a method to this I’m not understanding? I don’t want to manually parent a boneattachment to every gun as I may need to make changes later to the weapons glb and there’s no way of reparenting inherited nodes.

  • yes this can be done. I do this with swords. In blender parent the gun to the bone you want. Not parent to the armature, but parent to the bone.
    In blender with the armature in edit mode, select the bone you want. Then go back to object mode. Then parent the gun to the armature and select bone. You want to select keep transform or such as it don't import well into godot.

    I find it best to make a bone just for the gun in the armature. By dong this you can move it around without it deforming anything. You then can have bones for the gun on the side or back of the model.

yes this can be done. I do this with swords. In blender parent the gun to the bone you want. Not parent to the armature, but parent to the bone.
In blender with the armature in edit mode, select the bone you want. Then go back to object mode. Then parent the gun to the armature and select bone. You want to select keep transform or such as it don't import well into godot.

I find it best to make a bone just for the gun in the armature. By dong this you can move it around without it deforming anything. You then can have bones for the gun on the side or back of the model.

    newmodels thanks, this seemed to be the better of the options, but I found that the boneattachment Godot automatically made for the parented bone was offset very badly for some reason, is there a way around this?

    You would use BoneAttachment. You might just need to investigate why it's not working.

      cybereality

      cybereality it kinda is, but the importer is getting the position a bit wrong and I’m not sure why (since this is happening automatically)

      newmodels just to quickly clarify, do you make the bone for the gun in the armature for the arm or it’s own armature? Also, that Keep Transform suggestion might help the offset issue I was having…

      The bone is part of the model armature, there is one armature. How it's parented to that bone is probably the reason for the offset problem. I forget which option to choose, but there are two of them.