I need help with model tweening!

I need help.
so a while back i made an module for tweening models and published it just now, but i got comments about the code being deprecated. i have no idea how to make it better with the new api stuff and all info i’ve searched up is old or does not answer my question.

So… is there any way i can tween models on the server side using cframes and so i dont need to weld all the models?

2 Likes

I would recommend welding all the parts of the model to the model’s primary part and just tween the model’s primary part.

EXAMPLE:

local ModelPP = workspace.Model.PrimaryPart

local TInfo2 = TweenInfo.new(3, Enum.EasingStyle.Linear, Enum.EasingDirection.In)

TweenService:Create(ModelPP, TInfo2, {Orientation = ModelPP.Orientation + Vector3.new(0,0,10)}):Play()

You can create a CFrame value, and do a .changed event on the CFrame value and then tween the value… Sorry if that is confusing, not sure how to explain it well, but here’s an example:

local model = workspace.Model
local cframeValue = Instance.new("CFrameValue", workspace)

cframeValue.Changed:connect(function()
    model:PivotTo(cframeValue.Value)
end)

game:GetService("TweenService"):Create(cframeValue, TweenInfo.new(0.5), {Value = Your_CFrame_Here}):Play()

There is actually a really good resource already out there for your situation:

i need it to be anchored and i dont like welding models together.


i did not understand it.

Try welding all descendants to the Model’s PrimaryPart and tweening the PrimaryPart.

already answered.

i guess i can make an auto welding system but idk. ill try to find a way to move models via cframes (also that the model is anchored)


^^^^

Depending on what you’re doing, you could anchor it and script so before the tween starts, the model unanchors and then anchors again when the tween ended

1 Like

yea i could try to do that. good idea.

Alright, if it works, please mark the solution to your post :slight_smile:

To tween models, they need to be welded to the PrimaryPart and be unanchored (except for the PrimaryPart)

ok! thanks for the info! i will mark this as solved.

1 Like

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