Tween not working

The Tween is not working and I keep getting this error
TweenService:Create no property named 'CFrame' for object 'Gear'

Heres the code and im trying to tween a meshpart.

local Ownerid = script.Parent.Parent.Assets.OwnerId
local landingGearFolder = script.Parent.Parent.landingGear

local ts = game:GetService("TweenService")


local backgear = landingGearFolder.Gear
local backRoot = backgear.PrimaryPart

local backSwingInfo = TweenInfo.new()

local DoorSwingTween = ts:Create(backgear, backSwingInfo, {CFrame = backRoot.CFrame  * CFrame.Angles(0, math.rad(180), 0)})

wait(4)
backgear.RearLand.CanCollide = false
backgear.RearLand2.CanCollide = false
backSwingInfo:Play()
-- I'm testing to see it works then i will add it into the code / make the rest

prompt.Triggered:Connect(function(plr)
    if plr.UserId == Ownerid.Value then
        --nothing yet but as soon as you get in it tweens the landing gear in and you hover
    end
end)

Tweening CFrame is a little funky, but simple when you know how.
There is only one line you have to change, which is the one where you create the tween:

ts:Create(backgear, backSwingInfo, {["CFrame"] = backRoot.CFrame  * CFrame.Angles(0, math.rad(180), 0)})
1 Like

turns out I still got the same
Error

TweenService:Create no property named 'CFrame' for object 'Gear'

Then whatever you are attempting to tween doesnt have a CFrame property.

Can you give us the class name of the object you’re trying to tween?
Maybe a screenshot from the explorer along with the children of the Gear object?

image

Actually, do Gear.PrimaryPart
That might work.

the class name is model and the part inside for moving is a meshPart

I think changing it to Create(backgear.PrimaryPart, …) should work.