Code not tweening entire model even if everything set and welded correctly

Topic explains everything. Here is vid of what happens

Code:

--Before tween
local building = game:GetService("ReplicatedStorage").Buildings:FindFirstChild("PhotonUpgrades")
	local clone = building:Clone()
	clone.MainPart.CanCollide = false
	clone.Union.CanCollide = false
	clone.Union.BeamConnectMain.Beam.Enabled = false
	for _,beam in pairs(clone.Union.Photons:GetDescendants()) do
		if beam:IsA("Beam") then
			beam.Transparency = NumberSequence.new(1, 1)
		end
	end
	clone.Parent = workspace.FirstMap.Buildings
	local bc1 = clone.BuildingCamera1
	local bc2 = clone.BuildingCamera2
	ChangeCamera:Fire(clone, "Enable", bc1)
	ShakeCamera:Fire(clone)
	
	local SurfaceGUIs = player.PlayerGui.SurfaceGUIs
	local PhotonUI = SurfaceGUIs.PhotonUpgrades
	PhotonUI.Adornee = clone.GUIPart
	
	for _,motor in pairs(clone.Union.Motors:GetChildren()) do
		local weld = Instance.new("WeldConstraint")
		weld.Parent = motor
		weld.Part0 = motor
		weld.Part1 = clone.Union
		

		local MotorPart = motor.MotorPart
		local weld2 = Instance.new("WeldConstraint")
		weld2.Parent = MotorPart
		weld2.Part0 = MotorPart
		weld2.Part1 = motor
		MotorPart.Anchored = false
		MotorPart.HingeConstraint.Enabled = false
	end
		clone.Effects.Smoke.Enabled = true
		task.wait(1)
--at tween
local Goal = {Position = Vector3.new(clone.PrimaryPart.Position.X, clone.PrimaryPart.Position.Y + 75, clone.PrimaryPart.Position.Z)}
		local tween = TweenService:Create(clone.PrimaryPart, Info, Goal)
		tween:Play()
		tween.Completed:Connect(function()
		clone.Effects.Smoke.Enabled = false
		clone.MainPart.CanCollide = true
		clone.Union.CanCollide = true
...
1 Like

I would use this module I have called ModelTween. This makes tweening models pretty simple. All you need to do is to make sure you have a PrimaryPart Set in the right area.

Bruh, roblox tweening is same easy and requires same thing to work, i don’t really see difference, also this Currently the module is far from perfect and there are issues i need to fix the biggest problem currently is that tweening the same model twice at the same time will result model deformation so make sure u wait TweenTime before tweening the same part again i don’t really like this line. I need solution for default roblox tween

image
PrimaryPart properties

Still not solved. I already tryed everything. I tryed removing all anchored parts but this still gives issue.

EDIT: Also anchored parts are not welded to main model, i just don’t want them to tween

Try reading this resource, It might help you with your welding problem:

Besides welding, you can also use this code (with the PivotTo API):

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

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

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

As i already stated everything welded correctly same as stated in guide. Also every property set correctly. I absolutely have no idea why it don’t work

Could you try using the function I’ve showed you? You don’t need to weld anything with that function.

Well… I just found solution… I made goal CFrame instead of Position… and… now it tweens correctly??? I thought there is no difference in tweening model with position and tweening with cframe?

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