Item's CFrame changes when I "equip" it during player movement

So basically, I’m making a custom inventory system because Roblox’s default one has a few flaws. I got everything working right expect for the part when I equip the item, if I just don’t move and click 1 the items equips and teleports in my hand, but if I try to equip an item when my character is in motion the teleport bugs and the item is just moved into a random location near the hand. Here are some photos:

When moving:
image

When standing:
image

I used an item module to load all my icons and “position arrangements” for my items, here are the scripts I used:

Equip script:

Module script:

image

Please help me.

Don’t know if that’s the problem but you should always set the CFrame before welding the parts. ( from my experience )

That’s what I do. I did a few tests and I figured out to set CFrame before I weld.

image
This is changing the position not the CFrame by the way, I just misspelled

well whether your setting Position or CFrame they should both be put right before welding, Is the problem still going on?

Hold up, let me actually try setting the position and the cframe before the weld.

Same issue still; this is very confusing.

I guess I’ll wait till tomorrow for some other people to reply. I wanna sleep badly.

I believe the bug is because of how your setting the position.
Set the item’s CFrame before the weld, including its angle and position.

item.PrimaryPart.CFrame = plr.Character["Right Arm"].CFrame * module.Statistics[itemname].angles * CFrame.new(module.Statistics[itemname].cframeChange)

Hopefully this will give you consistent results.

Pretty sure that is supposed to be under #help-and-feedback:scripting-support , not #development-discussion .

Thanks, I edited the code a little bit and know it works.