Gun sliding system not working properly

I’m having issues with my gun system. Example here:
https://gyazo.com/8a3885c39c3ff19ba379772a82979453

The top grey part is the slider, and it is not moving whatsoever, no matter what I try.
My gun system is supposed to have a realistic oriented sliding system(this is the beginning without animations) and currently, it’s screwing up. Everything has CanCollide to false, and it may be caused by the weld for the slider connecting to the body of the gun.

I’ve tried changing a bunch of things up and I’m stuck here.

Code:

function slide()
	local tweenService = game:GetService("TweenService")
	local info = TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)

	local function tweenModel(model, CF)
		local CFrameValue = Instance.new("CFrameValue")
		CFrameValue.Value = model:GetPrimaryPartCFrame()

		CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
			model.PrimaryPart.CFrame = CFrameValue.Value
		end)
	
		local tween = tweenService:Create(CFrameValue, info, {Value = CF})
		tween:Play() 
		print("playing")
	
		tween.Completed:connect(function()
			print("completed")
			CFrameValue:Destroy()
			
		end)
	end
	local calc = script.Parent.Parent["Glock 19"].Slide.Model.Slide
	local c2 = calc.Parent
	local calcc = calc.CFrame
	local calc2 = calcc:ToWorldSpace(CFrame.new(0,0,3))
	tweenModel(c2, calc2)
	wait(1.5)
	tweenModel(c2, calcc)
end
script.Parent.Parent.Equipped:Connect(function()
	wait(1)
	slide()	
end)

I also know I shouldnt be using that code to tween, but I’m experimenting with it, I changed a thing or two up and I’m going to experiment more with it but any suggestions will be greatly appreciated. Thank you.

Are you trying to make some cocking animation for the gun when it fires?

if you are trying to make something like it then follow headstacks tutorial on animating guns

Why not welding the Slide and just tweening the C0 of the slide, i show you
https://gyazo.com/2cfcfcc70353200670ae7818731c3b44

I tried that. Currently i’m trying to avoid motor6ds and do a simple tweening procedure for the slide

Thats a good idea, but I want to try to use tweening so we don’t have to animate for each specific gun(if im correct about how the tutorial works)

animating it is an easy and reliable way

but there is one problem, lets say your making a bolt action. You animate the right hand to pull the bolt back then you put it in a tool and the entire rifle sticks to your right hand!

wow that looks hella laggy ???

you would have to create a script that makes a motor3d with your gun and your torso and it has to be client and server sided

no its not laggy Roblox made it so tools automatically stick to your right hand

I forgot to mention the only way you can disable that is by removing the handle to it and added motor6d between torso and gun

no its laggy from that gyazo that the one guy send

what do you mean? I just looked at it its not laggy

i use in my gun system the transparency change i have 2 different bolts
and i have a event fired when the gun was shot wich changes the transparency

https://gyazo.com/45c84338ab8702c5665b1f6ff36d7b96

that’s nice is there any others ways you do it?

he fires full auto and his bolt is moving slowly wich makes realisticly seen no sense. He fired multiple bullets while his bolt was still moving back so no new round would be put into the chamber to fire ???

true, he has to time it right or animate it again

no the only thing wich makes no sense in my gun script is that when i unjammed the gun the bolt didnt go directly forward but thats because i used a line wich waits for the animation to finish ill probaly gonna remove it so it looks smooth

okay nice hopefully it works great when your finished with it gtg