I’m working on an over-the-shoulder weapon system for my game, using the original R15 animation system I get the desired effect. When switching to the beta strafing animator it messes with the positioning, I assume it is something to do with the LowerTorso being animated. What would be the best way to resolve this issue while potentially keeping the beta animator?
The GIF shows how the weapon violently sways in the direction the character is moving when staffing, the weapon also pulls up when moving backward more than normal. The weapon should stay aligned with the rootpart/camera.
This is the code I use for alignment:
if self.values.shoulderEnabled then
rootPart.CFrame = rootPart.CFrame:Lerp(CFrame.new(rootPart.CFrame.Position, rootPart.CFrame.Position + newCameraCFrame.LookVector * Vector3.new(1, 0, 1)), 0.15)
upperTorso.Waist.C0 = upperTorso.Waist.C0:Lerp(
CFrame.new(upperTorso.Waist.C0.Position)
* CFrame.Angles(((currentCamera.CFrame.LookVector.Y) * 0.8 + (self.springs.recoil.Position.Y * 0.1)), 0, 0),
0.4
)
rightUpperArm.RightShoulder.C0 = rightUpperArm.RightShoulder.C0:Lerp(
CFrame.new(rightUpperArm.RightShoulder.C0.Position)
* CFrame.Angles(((currentCamera.CFrame.LookVector.Y) * 0.3 + (self.springs.recoil.Position.Y * 0.8)), 0, 0),
0.1
)
leftUpperArm.LeftShoulder.C0 = leftUpperArm.LeftShoulder.C0:Lerp(
CFrame.new(leftUpperArm.LeftShoulder.C0.Position)
* CFrame.Angles(((currentCamera.CFrame.LookVector.Y) * 0.3 + (self.springs.recoil.Position.Y * 0.8)), 0, 0),
0.1
)
head.Neck.C0 = head.Neck.C0:Lerp(CFrame.new(head.Neck.C0.Position), 0.2)
end
Is there any potential coding modifications I can apply to solve this issue? Thanks.