Hi I am currently trying to make a ball open and close when a player clicks on it, however the top part of the ball needs to rotate 90 degrees on the pivot point to open correctly and I have absolutely no idea how to go about doing this.
I have set the parts pivot point to the front bottom of the part so its right on where it should rotate, and i have even tried adding a small part in the same spot to try and get it to pivot around the part but this also didn’t work as intended.
Any help to point me in the right direction would be greatly appreciated
(image shows the closed ball and the open ball with the pivot part visible on the open ball)
local cframeValue = Instance.new("CFrameValue")
local openPart = -- path to open part
game.TweenService:Create(cframeValue, TweenInfo.new(2), {Value = CFrame.Angles(0, 0, -math.pi / 2)}):Play()
local originalPivot = openPart:GetPivot()
cframeValue:GetPropertyChangedSignal("Value"):Connect(function()
openPart:PivotTo(originalPivot * cframeValue.Value)
end)
game.TweenService:Create(cframeValue, TweenInfo.new(2), {Value = CFrame.Angles(0, 0, math.pi / 2)}):Play()
same thing except the inverse the sign for the rotation