A way to weld a part to a skinned mesh

For the past day I’ve been trying to find a way to attach a weapon to a skinned mesh character using a Motor6D.

The problem is that you can’t weld parts to bones, so I had to try random solutions such as creating two parts in the rig that animate and then weld the weapon to them, but the weapon still doesn’t move when the animation is playing. I also tried changing the position of the weapon every frame, but I can’t animate the weapon like this.

I don’t want to add bones to weapons and I’d prefer having the least changes possible to the rig. Is there a simple way to weld (using Motor6D) something to a bone?

This is the code I am using:

local weapon = workspace.Weapon:Clone()
weapon:SetPrimaryPartCFrame(viewModel.RightHand.RightHandMotor6D.Transform)
weapon.Parent = viewModel

local motor = Instance.new("Motor6D", viewModel)
motor.Part0 = viewModel.RightHand
motor.Part1 = weapon.Handle
3 Likes

I had the same issue a few months back, and I could not find a “proper” way to do this - I’m thinking it’s just not possible at the moment.
I ended up just setting the weapon’s cframe to match the cframe of the bone it’s attached to (plus an offset), every frame on both client and server. this works well enough for my case, even for collision detection etc

1 Like

I can’t believe that this feature didn’t release along-side with mesh deformation. I would’ve requested it if I had access to the feature request category.

I also tried setting the weapon’s cframe but I couldn’t animate the weapon with the character like that. May I ask how you dealt with creating animations with that method?

1 Like

Agreed - skinned character meshes are kinda useless without a proper way to attach things to them! Hopefully a better way comes along soon.
For my animations, I actually animated everything in an external software (Unity) because I already had all my characters and animations there, and imported the FBX via Roblox’s built-in animation plugin. It’s cludgy, and I’m not sure I would recommend this workflow if you’re not already familiar with Unity, but it works for me!

3 Likes

It’s like you took the words straight out of my mouth.

Thank you for your input on this! Looks like I’ll have to deal with custom welds for now (aaaaaaahhhh).

4 Likes

The fact that this still isn’t available is baffling, I was about to convert my game to skinned meshes and realized I couldn’t because of all the hurdles I would have to go through.

At this point I just attach whatever I need to the character’s RootPart and animate it (I am guessing that that’s what FriendlyStoneGolem did as well).

2 Likes

@DoorTamer I’d just like to inform you that the module is not for sale. How do I require the module then?

Can you show how your skin mesh looks like? Might help me to elaborate.

1 Like

My bad. quickly configures the model Now it is.

1 Like

I’m extremely confused as to why this would not release along-side the release of mesh deformation/skinned mesh.

I’m working with skinned mesh characters right now. Attaching objects such as fishing rods, swords and whatnot is straightforward, but using attachments to attach objects to those parts is impossible (that’s that it feels like, at least).

In my case, I’m attempting to attach a beam to a character’s sword. However, the beam will not attach to where the sword actually is in the game, instead it attaches to where it would be if the character was in an un-animated state (T-posing).

Am I doing something wrong?

Looks like this is going to be a feature soon.

6 Likes