I have a very large model that I need to tween all at once. I've used model:SetPrimaryPartCFrame inside of a for loop, but it's wayyy too jittery. Is there a way to utilize the tween service to make the movement of it smoother? I've tried some methods such as
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
but it always returns and error with the CFrame value when I do tweenService:Create().
What is the most efficient way to accomplish this?
The most efficient
way that I personally use is that:
1) I unanchor
all parts
2) I anchor
only one
part (which I am going to tween and use as my "PrimaryPart"
for that model)
3) I use Motor6Ds to weld all the parts together to the "PrimaryPart"
.
4) I then proceed to tween my anchored "PrimaryPart", and the model will follow
it.
Note: To make the process easier and faster I use this weld Plugin to make my Motor6D's, it is very helpful.
This is the smoothest
way to tween models to my knowledge after experimenting.
I hope this helps, please let me know if you have further questions!