Tween not rotating part around it's pivot

I’m trying to make a tween for an opening of a door. I want the door to rotate around the pivot that I have set for it.

The issue is that the door tweens to its goal in the most efficient way possible (not according to the pivot)

I have tried using the :ToPivot() method as for the whole model, but that was confusing and I wasn’t sure how to tween it efficiently. I know there are many posts on this but it all ends up not working for me.

I’ve also tried using Hinge Constraints, but those work physically. And I can’t really control it’s rotation so I prefer simply changing it’s CFrame.

I also think it’s important to note that I code this code from a post with a similar issue. After inspecting the code further I realised that it’s only helping it tween to the right position. But it didn’t fix the way it gets there.

local door = door.Door
local PivotOffset = door.PivotOffset.Position
local openDoor = TS:Create(door, TweenInfo.new(0.4), {CFrame = door.CFrame * CFrame.new(PivotOffset) * CFrame.Angles(0, math.rad(100), 0) * CFrame.new(PivotOffset)})
openDoor:Play()

bump… I’m really desperate, and I really need this door :c

Instead of messing around with setting a pivot point, a simpler way to do it would be to create a hinge part and set it as a PrimaryPart of the door model.

Like so in this tutorial:

In your case, the door is being moved into the set position, but with this method the PrimaryPart is being rotated to give a better opening/closing effect.

1 Like

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