Problem solved. I had no choice but to manually track the handbone’s cframe. By using “TransformedWorldCFrame”.
First of all I export the shotgun as a separate skinned mesh. Then import the .fbx file to roblox, with Constraint Details and Draw on Top enabled, you can see the bones.
Then I make a small part, it will act as the primarypart of the weapon. Named it “Root”. Then I welded it to the weapon body itself. The mesh named “XM” is the shotgun.
There are a lot of ways to weld stuff. I used a plugin to make life so much easier.
There we go, all the needed stuff is welded to the primarypart.
Now I add a code. The code will track the TransformedWordCFrame of the HandBone, every frame it will force set the primarypart’s cframe to the TransformWorldCFrame.
The results:
The code:
local RunService = game:GetService("RunService")
while true do
wait(RunService.RenderStepped)
workspace.PoliceModel.Shotgun.PrimaryPart.CFrame = script.Parent.TransformedWorldCFrame * CFrame.new(0,0,-0.09)
end
That’s what I mean of “every frame”, with the help of RunService, RenderStepped fires every frame. The code contains a loop that will track the HandBone then force position the shotgun to the hand.
Because of my persistent researching, I got an idea that might fix the problem it did work.
With “TransformWorldCFrame” that property is the real cframe of the bone when it gets animated.
Source: Skinned Mesh doesn't work with tools - #13 by banktoner