Uhh, some help needed on my Hanging knife thingy script

What exactly do you mean when you say it “breaks with other type of torso”?

ummm torso other than the default torso idk how to describe it

What exactly is the problem though? Is there an error, or does it just not look right? Just need a bit more information.

1 Like

This is what it’s supposed to do
arghhhhhhhhhhh1
But this happens whenever other type of torso is equipped, sometimes the knife falls off (the knife in this picture(2nd pic) is a skin and it has probably has nothing to do with it because the same thing happens with every other skins)
argggggggggggghhhhhhhhhhh

It’s really hard to see anything in those pictures haha. Do you get an error in your console at all? I suspect you would be.

Alright, i will take a new pictures and no, absolutely no errors

The problem is not in the different, packaged torsos, but in the different skins.
Different torso are just meshed regular ones, so they are not affected.

sadaaddadad


for some reason the knife replaces my leg too lol

Well, we’re trying but nothing you sent makes sense as to why it does that.
Can you send the entire script?

What are you changing with the torso, exactly?

Uhhh nothing but changing the torso to another type of torso in the avatar menu which everyone is able to do

Hmm, okay. Can you take a screenshot of your character model tree in the workspace window? That might give us a bit more information

For some reason, the weld isn’t anywhere in there (Lower Torso, KnifeLeft)


argggggggggghh

Ah there it is. In your KnifeLeft you have LeftHipRigAttachment. That’s what I was thinking it might be. Remove those attachments and welds from the knife. When a character is created it looks for those attachments in order to weld things.

eyyy one problem solved and now for some reason the weld gets removed and the knife falls right off
uhhhhhh

I made a mini tutorial on doing things like this. You can use my tutorial as a point of reference for your system, just change some names and positions around. You should, in fact, do it this way over hard-coded CFrame math so you can account for different avatar bundles which bring different hip positions.

Alright thanks, I will try this tomorrow as i’m going to sleep rn and finally I can sleep properly (hopefully xd) without my mind constantly thinking about a solution to a still unfixed bug that I’ve found and thinking about what else to do tomorrow, it’s hard being a developer and i’m tired, hopefully my game will come out to a success when it’s publicly released.

Uhh so how do I move the knife?

manually. By multiplying either C0 or C1 of the weld with CFrame Values.
Remember CFrame is tilted along with the object’s facing direction. CFrame.new(0,0,-1) to make it move forward, etc.

or make a tool yourself, by making two objects in a separate positions, then using a script to subtract the Knife part CFrame by the Part CFrame.
local C0 = Knife.CFrame * Part.CFrame:inverse()

Rotate the attachment in the actual knife. You can test this out with animation dummies in Roblox Studio since attachments will update live there as well. To do this:

  • Create an accessory and place your handle in there
  • Place the hip attachment you’re going for in the knife
  • Put the accessory in the Humanoid, the Humanoid should equip it automatically
  • Reposition the accessory until you get something you like

You can then either store the knife model in a storage service or use the position/orientation to instance attachments (similarly to how you instanced welds beforehand). Position is relative so you don’t have to worry about any weird calculations if you prefer to instance.

I personally would keep this newly made accessory in ServerStorage and attach it to the character when they spawn, then just change its texture based on if a knife skin is equipped or not. I don’t like to go the extra mile to write code to create instances if I’m able to avoid doing so (though this is at the cost of using up memory for static objects - not enough to be harmful though).

Here’s a video of me doing everything, from setting up the accessory to changing the positions, from start to finish:
https://streamable.com/fbxe2

And here is the file for the finished product I made directly from the video:
MM2 Style Waist Knife Repro.rbxl (37.1 KB)

Note that your axis will probably be inverted when moving things around, so just keep that in mind. If you can visually get the knife at a good point on the limb, that’s good and you should be all set.


@Amatzukaze

Assuming that OP has decided to follow my advice, C0 and C1 are irrelevant in this scenario and should not be used. There is a weld created between the attachments of the limb and the actual part in the accessory but that’s taken care of automatically when the accessory is added to the Humanoid.

In addition, a hard set CFrame, like I said earlier, doesn’t account for arbitrary limb positions which differ when users equip new packages or change their body scales, so there’ll be an observable discrepancy which may not be desired.

When working with my accessory method, you must use the properties of the attachment prior to adding the accessory to the Humanoid. Don’t touch the weld.