Simple TweenService help

Simple error that I for some reason couldn’t find on devforum, or atleast the ones I did didn’t give results.

So I’m not very good with TweenService, I’m simply trying to animate barrel recoil by moving the canon 1 stud back and I want to use CFrame since the canon can move whilst animating.

In order to test if the script works I wrote this, however I get no movement. Why does this occur and how do I fix it?

local frame = script.Parent.Turret.Right_Barrel.Main_Frame
local test = TS:Create(frame, TweenInfo.new(0.5), {CFrame = frame.CFrame * CFrame.new(-1,0,0)})
test:Play()

Is there an error in the output?
Is your target part Anchored? (tweenservice only works if the part is anchored)

1 Like

No errors but the part in unanchored,

But why does it work if I use Position instead of Cframe?

I mean, it does work when unanchored, but because of physics you might not notice. I tested your code with a normal part in workspace, and it seems to work for me, so maybe your object is too heavy?

1 Like

It might be due to the welds to, since the canons are welded to the turret?

I added welds to my part and it doesn’t work anymore, so maybe it is because welding two parts makes the assembly too heavy for tweenservice to move?

You could try to move the part with forces instead.

1 Like

Alright, thank you. Do you recommend any specific forces?

LinearVelocity is the simplest one in my opinion, but you choose the one that you think is best.

1 Like