I’m trying to tween a model with multiple parts and when using CFrame the SetPrimaryPartCFrame positioned my whole model to where the tween starts off but the tween only tweens the primary part. How can I make the whole model tween like how SetPrimaryPartCFrame?
Plant = game.ReplicatedStorage.PlantingObjects.CabbageSeed:Clone()
Plant.Parent = Soil.Parent
local PlantCf = Plant:GetPrimaryPartCFrame()
local SoilCF = CFrame.new(Soil.CFrame.X, Soil.CFrame.Y - 5, Soil.CFrame.Z)
Plant:SetPrimaryPartCFrame(SoilCF * CFrame.Angles(math.rad(0), math.rad(0), math.rad(90))) -- This set the whole model. The Tween:Create() doesn't...
GrowTime = 10 / Divide
Tween = TweenInfo.new(GrowTime)
SoilCF = Soil.CFrame
local TweenPlant = TweenService:Create(Plant.PrimaryPart, Tween, {CFrame = SoilCF * CFrame.Angles(math.rad(0), math.rad(0), math.rad(90))})
print(SoilCF)
TweenPlant:Play()
You can create a CFrameValue where the instance’s values is set to the initial CFrame. This CFrameValue is what you will tween to the desired CFrame and use a Heartbeat event to use SetPrimaryPartCFrame to CFrame the model:
The expectation of this method is that the rest of the parts in your model are unanchored and welded to the PrimaryPart. If this isn’t done, then yes only the PrimaryPart would get tweened.