Part keeps tweening to the original model instead of the clone

I am trying to tween the roof of a crate so that it looks like the crate is being opened.

The issue is that every time this tween runs, the lid goes to the position on the original model for the crate and not the cloned model.

How do I fix this issue?

Code:

If needed, I can show a visual example.

It seems like when you destroy the weld to the lid, you’re doing it before changing the crates position, which means the unanchored lid is in its old position. Try destroying the weld after adjusting the crate to the new position.

[video removed due to solution]

Yeah, LidGoPos would be in its old spot because your defining LidGoPos before adjusting the cloned crate to the new spot.

	LidGoPos = Crate.LidGoPos.CFrame -- The location you want to tween to is defined here, while the crate
	
	crateTween = TweenService:Create(Crate.PrimaryPart, TweenInfo.new(1, Enum.EasingStyle.Bounce), {CFrame = FallingCratePos})
	
	crateLidTween = TweenService:Create(Crate.Lid.PrimaryPart, TweenInfo.new(0.5, Enum.EasingStyle.Back), {CFrame = LidGoPos}) -- the tween would then adjust it to the old spot
	
	Crate.PrimaryPart.CFrame = StartingCratePos -- You adjust the position of the crate after the fact

I moved the crates position being changed to happen before LidGoPos is defined, but the issue still occurs.

hmmm, il try to come up with a solution in studio, give me a few minutes

Could you send me the adjusted script?

[Code removed due to solution]

Try moving
Crate.LidGoPos.TrueCenter:Destroy() -- destroy weld
to after
LidGoPos = Crate.LidGoPos.CFrame

The lid now teleports to that starting position.

I fixed the issue by moving the tween and LidGoPos being set to after the tween where the crates position on the ground is set.

2 Likes

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