Hello guys! it’s my first time creating a topic on dev forum because I really couldn’t find the solution for my issue, ok, here I go.
I know that I can’t access the Part because viewport is to display 3D objects within 2D UI. There is a way to access the Parts inside a ViewPortFrame clicking on it?
There is an example:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local viewPort =script.Parent:WaitForChild('ViewportFrame')
--Create Camera
local camera = Instance.new("Camera", script.Parent)
camera.CameraType = Enum.CameraType.Fixed
camera.Name = 'MinimapCamera'
viewPort.CurrentCamera = camera
camera.CFrame = CFrame.new(Vector3.new(0,335,0), Vector3.new(0,0,0))
-- My Problem is here, how can I access it?
viewPort.Space.Base.ClickDetector.MouseClick:Connect(function()
print(mouse.X..', '..mouse.Y)
end)
What I’m trying to do is a MiniMap, I want to get the position of the Base using ClickDectector to move Character to the Base Position but, how I do that?
Thanks!
That is true, I tested it in Studio with ClickDetectors, Buttons on SurfaceGui’s, and buttons on BillboardGui’s. ViewportFrames do not support input from any of its children. This would make sense since these frames are only meant to be used to display parts, not interact with them.
If that is your final conclusion, don’t forget to tag your own reply as the solution!