Tweening positions are not the same

Hello!
I am trying to tween some doors for an entrance.
When I open the doors, it works out smoothly.
But when I close the doors, they don’t get back to their original position.

Here is the code.

-- Open doors
Tween:FireAllClients(7,"Sine","Out",{CFrame = self.Lift.LeftDoor.Main.CFrame + (-self.DoorDir * 30)},self.Lift.LeftDoor.Main)
Tween:FireAllClients(7,"Sine","Out",{CFrame = self.Lift.RightDoor.Main.CFrame + (self.DoorDir * 30)},self.Lift.RightDoor.Main)
wait(10)
-- Close doors
Tween:FireAllClients(7,"Sine","Out",{CFrame = self.Lift.LeftDoor.Main.CFrame - (-self.DoorDir * 30)},self.Lift.LeftDoor.Main)
Tween:FireAllClients(7,"Sine","Out",{CFrame = self.Lift.RightDoor.Main.CFrame - (self.DoorDir * 30)},self.Lift.RightDoor.Main)

How do I fix this?

You could store the doors’ original cframes as variables and send that to the clients afterwards.

1 Like

The problem is that the doors are going to be welded next and move with the lift.

I don’t remember if this is correct have you tried changing one of your integers to a negative

Changing the Out in Closing with In

What do you mean by changing an “integer”?

1 Like

@HugeCoolboy2007’s sentiment is still correct even in light of this, although it will need to be tweaked slightly.

You will want to store the door’s relative offset to the lift they will be attached to. When you tell your clients to open and close the doors, you will want to use the lift’s current position as the starting point and then add these offsets to achieve your endpoints.

Yes, that’s what I meant.eoops

Where do I find the relative offset?

Nevermind, I realised this is being tweened on the client and the door positions are kept the same.