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()