How to tween a slide on a gun tool?

How’s your code looking right now?

local TweenService = game:GetService("TweenService")

			local TweenerInfo = TweenInfo.new(0.35, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, true)

			local shotAnimation = TweenService:Create(script.Parent.Gun.Barrel.qCFrameWeldThingy, 
				TweenerInfo, 
				{C1 = CFrame.new(Vector3.new(0, 0, script.Parent.Gun.Barrel.qCFrameWeldThingy.C1.CFrame.LookVector.Z - 0.4), script.Parent.Gun.Barrel.qCFrameWeldThingy.C1.CFrame.Orientation)})

				shotAnimation:Play()

My bad. Remove the CFrame between the C1 and LookVector.

still the same error… Barrel.qCFrameWeldThingy.C1.LookVector.Z wait im going to try it with the cframe removed on the other line too, alright when i do that it says orientation is not a valid member of cframe

Just try searching other posts.
I typed in “gun slide animation” and came up with a few posts about it, one that mentions tweening in the description.

right but like I stated in my post I cant use animations, I need to use tweenservice.

any idea for a fix since that didnt work?

I mentioned tweenservice in that post as well…

Could you give me a place file so I can look at it and do my trial and errors?

Also, what type of weld is it? That’s a contribution to the problem. If it was a WeldConstraint, it wouldn’t have either C1 or C0.

instead of using C1 you can possibly using CFrame instead

local shotAnimation = TweenService:Create(script.Parent.Gun.Barrel, 
				TweenerInfo, 
				{C1 = CFrame.new(Vector3.new(0, 0, script.Parent.Gun.Barrel.CFrame.LookVector.Z - 0.4), script.Parent.Gun.Barrel.CFrame.Orientation)})

Zylo all you have to do is create a motor6d to the weapons handle and animate it accordingly with the motor6d.

the motor6d allows you to freely move the slide part anyway u want forward backward etc .

the use of animations to move the slide is very simple yet not so hard to accomplish.

i have done it several times etc in my gun system.

DO NOT WELD ANIMATED PARTS u motor6d them.
and tweening parts of weapons is not really ideal

if this was ur answer please set this as the solution.

IF YOU WANT TO LEARN ABT THIS PLS GO HERE!

A POST BY HEADSTACKK ON HOW TO ANIMATE PARTS

its a normal weld, no weldconstraint.

but I need my thing to be in a script and with no animations.

why? just add an animation and load the animation each time ur shooting event is fired.

is it not possible with a script?

it is but id say do animations bro. using scripts is unneeded and not really the best thing.

loading animations is much easier then tweening or cframing stuff.

Well you could do a motor 6d animation that plays every time you fire the tool. I Reconmend to learn motor 6d animations.

I want to use cframes because I have tons of guns and going in and animating the slide on each one is harder than just a script.

like i said its easier animating the weapons instead of cframing a welded part…