I made a very simple door script that utilizes the TweenService
to rotate the door when prompted, but when the door rotates, it rotates off of the original pivot point position despite having pivot offset.
Script:
local door = game.Workspace:WaitForChild("Door")
local prox = door:WaitForChild("ProximityPrompt")
local tweenService = game:GetService("TweenService")
local goal = {}
goal.Rotation = Vector3.new(0,90,0)
local tweenInfo = TweenInfo.new(
2,
Enum.EasingStyle.Sine,
Enum.EasingDirection.Out,
0,
false,
0
)
local tween = tweenService:Create(door, tweenInfo, goal)
prox.Triggered:Connect(function(player)
tween:Play()
end)