Tweening model relative to it's primary part

i’m trying to tween my tape model relative to it’s primary part so that it’ll slide in and out of the measuring tape. unfortunately at the moment the tape spins around.

local TweenService = game:GetService("TweenService")
local tapeGroup = script.Parent
local tape = tapeGroup.PrimaryPart
local Weld : Weld = tape.metal
local startCF = tape.CFrame
local endCF = CFrame.new(133.851, 3.148, 208.789)
local tweenInfo = TweenInfo.new(1.5, Enum.EasingStyle.Back, Enum.EasingDirection.InOut, -1, true, 0)

local tapeTween = TweenService:Create(tape, tweenInfo, {CFrame = endCF})
tapeTween:Play()


24419ff72920eac2bbaf18426fc734bd

endCF doesn’t have any angles attached in it, you could could get the correct angles but it’ll be easier to just use the current CFrame of the tape and adjust the position that way.

{CFrame = tape.CFrame*CFrame.new(0,0,-3)} -- I believe negative numbers on the z axis makes it go forwards
1 Like

oh yea; this actually worked perfectly for me. thanks a million for ur help noob!! :slight_smile:

local tapeTween = TweenService:Create(tape, tweenInfo, {CFrame = startCF * CFrame.new(0.8,0,0)})
tapeTween:Play()

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.