How to weld a weapon to a player's model?

I’m looking for a way to create a sword that is not a tool, and is always active. Think a weapon that you can’t unequip by pressing the number buttons. Instead, it’s always equipped and the player can click at any time to attack.

The problem I’ve run into is that I don’t know how to weld the sword to the playermodel. I want to be able to animate the sword with Moon Animator, so I want it to physically be part of the player’s model.

I followed the guide under this post about accessories but that didn’t work for me. I would really prefer to not make it a tool, as the weapon is going to have multiple attacks that can be used by pressing keys.

What should I do here? Should I just make the starter player be a standard rig with a sword welded to it? Or is there some kind of script that can attach the sword to the arm? Sorry if this is vague. I can send pictures of what I’m trying to achieve when I get home.

2 Likes

Its a bit complicated explaining it in text, I suggest you to learn welding through videos.

4 Likes

All you have to do is go into the moon animator plugin and click easy weld after that then click the arm you want the sword to be on and then the sword itself, then click “Join In Place”, this keeps whatever your welding to keep its CFrame

1 Like

yes thank you. but how would i weld it to the player character’s model? do i make that rig with the weld the starter character?

1 Like

Oh you just select the part you want to weld it too like say you want to weld the part to your left arm just weld it to the left arm, then make sure to put the part inside of the players character

2 Likes

Ok, so I feel I should clarify some things. I want to make a custom tool system, similar to games like DemonFall, where you press R or something to draw your sword without there being a toolbar at the bottom for the sword. I’m trying to figure out how I could do this, but it’s so hard to find information on this. As I said before, I used this forum to try and get help, but the last time it was posted on was in April of 2021. Even if it does still work, it’s not working for me for some reason. The object I’m trying to weld to the player’s hand doesn’t even appear when I put the accessory into ServerStorage. This is frustrating me so much because in order to make literally any progress on my game I need this mechanic to work. Does anyone have an answer for this? Reviewing what welding is and what it does doesn’t exactly help me figure out how to weld the tool to the player’s hand, and I don’t know how I would switch the weapons when needed, like spawning players with other weapons aside from the one I’m currently making.

1 Like

i vaguely remember scripting a system that probably doesnt work but, for the most part, achieved this.
what you want to do is take your model, and add an invisible block. call this the “grip” or “handle”, like you would do with a tool. but; make sure this part is oriented along your model; the front of the grip needs to correspond with the front of, lets say, a gun.

then, using scripts, set the position of the model’s Primary Part (which needs to be the grip) to whatever body part you want it to attach to. for my stupid sheath model, I planned on the grip teleporting to the center of the torso, and so I positioned it on my sheath model so that when it copied the position of the torso identically, the actual model part would end up on the player’s back.
you should use :PivotTo in order to do this, because if you dont, the other parts in your model will just get left behind.

after this, weld the grip to your body part. or use a motor6d. this should be pretty easy.

annd when youre done with that, you should have some rudimentary part sticking from your character! as far as animations go, I think if the rigs are identical- i.e, if you recreate the rig you originally animated on- you should be able to play animations.

i tested it and it does work! as long as the “grip” part works … basically like an attachment, it will connect to the model at that point. just make the grip invisible, and you have whatever you want! in my case, i have a large white block that stands in as a sheath model.

note that this probably wont work if your game allows r15 and r6, as occasionally body parts wont match up, and grip placements will need to differ.

just a tip though, you might want to orient your model ON a human rig, and then attach it, just so it attaches the way you want. this part is really tricky.

overall, you should probably just use the built in attachment system, since this is basically just a recreation of it.

image

you can even see the transparent part on my characters torso; thats the grip. the rest would be your intended model.