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.
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!
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 ???
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