#Tweening with CFrame help

37 messages · Page 1 of 1 (latest)

glad smelt
#

local tweenPart = tweenService:Create(part, tweenInfo, {CFrame = part.CFrame + CFrame.new(0, 10, 0)})
Why isn't this working? It says "Attempt to index nil with 'CFrame'"

vague bough
#

maybe your part is nil?

#

try printing it before the tween

glad smelt
#

Oh yeah found it, i didnt make the variable correct for the part

glad smelt
# vague bough maybe your part is nil?

One more question though,
local tweenPart = tweenService:Create(part, tweenInfo, {["CFrame"] = CFrame.new(-4.682, 11.5, -26.812)})
This works, but why doesn't this work:
local tweenPart = tweenService:Create(part, tweenInfo, {["CFrame"] = part.CFrame + CFrame.new(0, 10, 0)})

vague bough
#

why you put ["CFrame"]

vague bough
glad smelt
glad smelt
vague bough
#

uhm

glad smelt
#

Maybe part.CFrame.Position?

quartz driftBOT
#

studio** You are now Level 3! **studio

vague bough
#

nah

glad smelt
#

ah

vague bough
#

why tf it says vector3 ;-;

glad smelt
#

Idfk

vague bough
#
local tweenPart = tweenService:Create(part, tweenInfo, {CFrame = part.CFrame + CFrame.new(0, 10, 0)})
#

it won't work 😭

glad smelt
#

Broo

#

When i put part.Position it says "vector3 expected, got cframe

vague bough
#

ofc

#

Position is Vector3

#

CFrame is CFrame

glad smelt
#

and when i put part.CFrame it says the opposite

#

yeah

vague bough
#

maybe

#

make a variable

#
local goal = (part.CFrame + CFrame.new(0, 10, 0))
local tweenPart = tweenService:Create(part, tweenInfo, {CFrame = goal})
#

idk how to help you

vague bough
glad smelt
#

Damn thanks anyways brocrying

#

I finally figured it out

#

`local goal = (CFrame.new(part.CFrame.X, part.CFrame.Y + 10, part.CFrame.Z))

local tweenPart = tweenService:Create(part, tweenInfo, {CFrame = goal})`

#

this was it

#

I think lua doesnt let you add values to cframes

#

like in the way i tried before