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

can you tween Models using TweenService?

So recently I was just testing the limits of TweenService and how far you can push it. It wasn't long before I discovered you can't tween whole models(At least I think). If there is anyway you could tween models using TweenService and not lerp I would be curious to see and yes I did try to weld the model together and then tween it using it's primary part. It doesn't work.

3 comments

0

I also tried tweening them but never worked.

0

I don't think so. You can only tween each individual part in the model

0

You actually can tween an entire model just by using parts all attached to the primary part with WeldConstraints and just moving the primary part. It's quite hacky, but it works.

1 answer

✓ Accepted answer

I'm not gonna take the credit for this code, as I did not write it. This question has been asked on Roblox's Devforums before, and has been answered.

local tweenService = game:GetService("TweenService")
local info = TweenInfo.new()

local function tweenModel(model, CF)
	local CFrameValue = Instance.new("CFrameValue")
	CFrameValue.Value = model:GetPrimaryPartCFrame()

	CFrameValue:GetPropertyChangedSignal("Value"):connect(function()
		model:SetPrimaryPartCFrame(CFrameValue.Value)
	end)
	
	local tween = tweenService:Create(CFrameValue, info, {Value = CF})
	tween:Play()
	
	tween.Completed:connect(function()
		CFrameValue:Destroy()
	end)
end

If you would like to check the original post, and support the original programmer, click here

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