Hi, I am trying to rotate a door around a pivot point (like a hinge) that are anchored, so I am using tweens to animate it. I have followed many tutorials and have just managed to get to this point, but I have no idea what to do now as for some reason the door rotates into the hinge for a moment when it turns around. Demo:
Script:
local tweenservice = game:GetService("TweenService")
local door = script.Parent.Parent
local piv = door.Parent.PrimaryPart
local offset = piv.CFrame:Inverse() * door.CFrame
local info = TweenInfo.new(1,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut, 0, false, 0)
local tween = tweenservice:Create(door, info,{CFrame = piv.CFrame * CFrame.Angles(0, math.rad(90), 0) * offset})
function left()
tween:Play()
end
You can leave the pivot point anchored and the door unanchored, and then you can use a Servo.
Also, if you are wondering the reason is that your door is moving linearly:
Left is the desired result, right is reality.
Since you are moving linearly your door will move backwards since what you need is not a linear motion but instead a circular one like in the left diagram.
The reason the door is anchored is because with Constraints in ROBLOX there is always the issue that they can be very glitched via some moving physics object pushing into it at the wrong angle, I don’t want any chance of that
Though the diagrams are useful
i dont want to unanchor it. roblox physics are unreliable imo and i dont want the door glitching all over the place cause of a collision issue.
is there really no way to just tween in a realistic circular motion around the hinge point?