Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Tween teleporting above object?

How could I stop this from happening? I've tried using the part's CFrame value's in an attempt to keep the part where it is but it keeps jittering back and forth above the object it comes out of.

Here's a link to a video of what's happening: https://streamable.com/1e2oo

Here's the code:

local things = {
	Position = Vector3.new(42.3, 1.8, 51.7)
}
local tweeninfo = TweenInfo.new(
	2,--Tween time
	Enum.EasingStyle.Quad,
	Enum.EasingDirection.Out,
	1,
	true,
	2
	)
	local tween = ts:Create(boxpart,tweeninfo,things)

Many things are pre-defined so there's no issue there.

2 comments

0

Try setting canCollide on the part that u want to tween (the part that is flying)

0

it's already off

1 answer

✓ Accepted answer

This is due to the fact that you are tweening the wrong property. Try changing the things table to

local things = {
	CFrame = CFrame.new(42.3, 1.8, 51.7)
}

That should instead reposition the object using CFrame. Here is the end result (I renamed some of your variables for readability) :

local properties = { CFrame = CFrame.new(42.3, 1.8, 51.7) }
local info = TweenInfo.new(2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 1, true, 2)

local tween = ts:Create(boxpart, info, properties)

This discussion is preserved as it was. New answers, comments, and votes are closed.