Transforming verts based off of bone cframes

I feel like this is too complicated for the devforum but whatever. I’m currently trying to create custom collisions for skinned meshes. I’ve parsed all of the mesh data etc but I’m not sure how exactly to calculate the correct position since there’s not much easy to find data online about it. Here’s my code currently:

for i, Vert in self.InternalClass.Verts do
			local c = 0
			for _,v in Vert.Weights do
				c+=1
			end
			local TotalInfluence = 0
			for _, v in Vert.Weights do
				TotalInfluence+=v
			end
			local FinalPos = Vector3.new(0,0,0)
			for Bone, Weight in Vert.Weights do
				
				local Matrix = CFrame.fromEulerAnglesXYZ(self.GetBoneByName(Bone).CFrame:ToEulerAnglesXYZ())
				FinalPos = FinalPos + (Matrix * (CFrame.new(self.FrozenInternalClass.Verts[i].Position)).Position * (Weight / TotalInfluence))
				
			end
			Vert.Position = FinalPos
		end

(the weights are in 0-255 range but when I divide it by 255 it breaks so I’m just leaving that there)
and this is the result it generates:

image

(left is expected result, right is result)
I feel like I’m on the right track but I’m not sure what specifically I’m doing wrong. Here’s the mesh parser I’m using: https://github.com/MaximumADHD/cage-mesh-deformer/blob/main/Modules/RobloxMesh.lua

I know it’s like complicated math but thanks if y’all happen to know it