I am trying to display two of the same VPF in a menu like so:
However I am not sure of the best method to do so, I tried at first to generate two VPF based on the tool provided. It worked, but I think it is not the optimal approach (I have to set items to visible false/true each time and I think it just generates too many VPF for no reason imo).
local toolClone=tool:Clone()
toolClone.Parent = workspace
toolClone.Parent = Tool.ViewportFrame.WorldModel
local handle = toolClone:findFirstChild("Handle")
handle.Anchored = true
local cam = Instance.new("Camera",Tool.ViewportFrame.WorldModel)
handle.Position = Vector3.new(0,0,0)
local maxSize = math.max(handle.Size.X,handle.Size.Y,handle.Size.Z)
cam.CFrame = CFrame.new(Vector3.new(0,0,maxSize), handle.Position )
Tool.ViewportFrame.CurrentCamera = cam
local increment=360/80
coroutine.wrap(function()
while true do
for deg=0, 360, increment do
handle.CFrame=CFrame.new(handle.Position)*CFrame.Angles(math.rad(280),0,math.rad(deg))
wait()
end
end
end)()
--2nd part is missing because it is redundant, just imagine a copy of the above but where I generate a new VPF for each tool.
My next attempt was to set the Current Camera of the side’s VPF (when player selects an inner menu item) to the inner menu’s item but that didn’t seem to work
function OnItemSelect(Item)
Side.Item_Buy.Visible=true
Side.Item_Price.Visible=true
Side.ViewportFrame.CurrentCamera=Item.ViewportFrame.WorldModel.Camera
Any thoughts?