Motor6D stretching the planes of existence, opening the gates to oblivion, and crashing studio

I’m not at all sure what happening here or exactly how to replicate it, but I welded a gun together using Motor6D and upon doing something, the gun stretches / distorts. http://i.imgur.com/Jyizsuc.jpg

I can kind of replicate it but I’m not exactly sure what’s going on to make it do this. I didn’t know this was even possible.

Edit: Video showing it: https://www.youtube.com/watch?v=yU-vPKSl0dk&feature=youtu.be

edit2: I realized that these lines are what are majorly contributing to the bug:

L1. local RA = game.Workspace.CurrentCamera.FPSModel.Right.AnimateBrick
L2. local newR = game.Workspace.CurrentCamera.FPSModel.Animations.Scoped.Right.f1.CFrame:inverse() * RA.CFrame * RA.AnimWeld.C0
L3. RA.AnimWeld.C0 = newR

One of the offset cframes could be malformed

How do I check for that?

Okay it looks like matrix creep. Every time you update the offset, it loses a little precision, until it drifts into chaos. If the offsets are constant, try storing them instead of getting it each time.
(also beware of this when using model:SetPrimaryPartCFrame)

Okay I’ll look into that. By the way, when the gun was done using Welds instead of Motor6D, there was no issue like this.

Use Motor not Motor6D.

I don’t know if it will help but I know I’ve never had problems with Motors.

I’m using Motor6D because it has better precision when needing to move complicated parts in stressed servers. Does Motor do the same?

Motor doesn’t have the same move-parts-with-anchored-parts thing that Motor6D does. If you’re getting stretching, it means your CFrame math is wrong.

The math works fine with normal welds. The error occurs when this happens:

L1. local RA = game.Workspace.CurrentCamera.FPSModel.Right.AnimateBrick
L2. local newR = game.Workspace.CurrentCamera.FPSModel.Animations.Scoped.Right.f1.CFrame:inverse() * RA.CFrame * RA.AnimWeld.C0
L3. RA.AnimWeld.C0 = newR