Hello!
I am trying to make the character’s arms shake when it fires a weapon. I am doing this procedurally, so without key framed animations.
To accomplish the procedural side of things I made a custom procedural animation module a while back which has no bugs that could be introducing the problem at hand.
When manipulating the Motor6Ds to shake the arms using Motor6D.Transform it doesn’t actually do anything. Even worse, it seems to be changing the Motor6D.C0 to CFrame.new(). Why is it doing this and how do I fix it?
I’ve tried all the solutions I can think of, including doing away with the Motor6Ds altogether. Some solutions have worked, but because I want to work with other procedural elements on top of the arm shake, I couldn’t use those solutions since they were half measures. I’ve tried only using Motor6D.C0 But that seems to have just bugged the key framed animations.
local Motor6Ds : M6DTable = {
RightShoulder = AnimInst.PlayerData.Character.LeftUpperArm.LeftShoulder;
LeftShoulder = AnimInst.PlayerData.Character.RightUpperArm.RightShoulder;
}
local LeftArmDefault = MovedArmRootCF:ToObjectSpace(Motor6Ds.LeftShoulder.Part1.CFrame)
local RightArmDefault = MovedArmRootCF:ToObjectSpace(Motor6Ds.RightShoulder.Part1.CFrame)
local function Update(dt:number)
InterpCF = ShootProcedural:UpdateCFrame(TargetCF, Motor6Ds.LeftShoulder.C1, dt) -- My custom procedural animation module.
if TarDistance > (TargetCF.Position - InterpCF.Position).Magnitude then
TargetCF = CFrame.new()
end
MovedArmRootCF = OffsetCFByCF(Motor6Ds.LeftShoulder.Part0.CFrame, ArmRootCF.Value)
local InterpArmRoot = OffsetCFByCF(InterpCF, MovedArmRootCF)
for _, Motor6D:Motor6D in pairs(Motor6Ds) do
Motor6D.C1 = CFrame.new()
end
Motor6Ds.LeftShoulder.Transform = Motor6Ds.LeftShoulder.Transform * (Motor6Ds.LeftShoulder.Part0.CFrame:ToObjectSpace(InterpArmRoot:ToWorldSpace(LeftArmDefault))) -- All this extra stuff after "Motor6Ds.RightShoulder.Transform" is just extra calculations to make sure all the limbs stay together and don't float around.
Motor6Ds.RightShoulder.Transform = Motor6Ds.RightShoulder.Transform * (Motor6Ds.RightShoulder.Part0.CFrame:ToObjectSpace(InterpArmRoot:ToWorldSpace(RightArmDefault)))
end
Here is an image of the failed transformations:
