local gui = script.Parent local camera = workspace.CurrentCamera local viewPortFrame =…
- User
local gui = script.Parent local camera = workspace.CurrentCamera local viewPortFrame = gui.Minimap local playerIcon = viewPortFrame.DirectionArrow local clicked = false
for i, descendat in ipairs(workspace.MinimapObjects.Map:GetDescendants()) do if descendat:IsA("BasePart") then local clone = descendat:Clone() clone.Transparency = 0 clone.Parent = viewPortFrame end end
local viewPortCamera = Instance.new("Camera") viewPortCamera.FieldOfView = 70 viewPortFrame.CurrentCamera = viewPortCamera
local offset = Vector3.new(0, 525, 0)
camera:GetPropertyChangedSignal("Focus"):Connect(function() local position = Vector3.new(0, 0, 0) viewPortCamera.CFrame = CFrame.lookAt(position + offset, position -Vector3.zAxis) end)
local MapGUIsize = 0.25 local player = game.Players.LocalPlayer local MapSize = 1000 coroutine.wrap(function() while wait(0) do local character = player.Character local HumanoidRootPart = character:FindFirstChild("HumanoidRootPart") if HumanoidRootPart then local X =(HumanoidRootPart.Position.X+(MapSize/2))/MapSize local Y = (HumanoidRootPart.Position.Z+(MapSize/2))/MapSize local position = HumanoidRootPart.Position playerIcon.Rotation = -HumanoidRootPart.Orientation.Y playerIcon.Position = UDim2.new(X,0,Y,0) end end end)()
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function() clicked = true end)
mouse.Button1Up:Connect(function() clicked = false end)
viewPortFrame.MouseMoved:Connect(function(x, y) if clicked == true then local cameraPart = game.Workspace.CameraPart cameraPart.CFrame = CFrame.new(((x)/MapSize) * MapSize - (MapSize/2), cameraPart.Position.Y, ((y)/MapSize) * MapSize - (MapSize/2)) end end) СДЕЛАЙ ТАК ЧТОБЫ PART CAMERAPART ПЕРЕДВИГАЛСЯ ТУДА КУДА Я КЛИКНУ НА МИНИКАРТЕ. СЕЙЧАС ОНО РАБОТАЕТ, НО КОГДА КЛИКАЮ ПОКАЗЫВАЕТ ЛИШЬ ОДНУ ПЯТУЮ ОТ ПОЛНОЙ КАРТЫ. (КООРДИНАТЫ НАЧАЛА КАРТЫ ТУТ vECTOR3.NEW(383, -1.52, -399) А ЗАКАНЧИВАЕТСЯ ОНА НА КООРДИНАТАХ vECTOR3.NEW(-398, -0.466, 401.5)
- Assistant
To make the "CameraPart" move to the clicked location on the minimap, you can use the following code:
lualocal cameraPart = game.Workspace.CameraPart viewPortFrame.MouseButton1Down:Connect(function(x, y) clicked = true local position = Vector3.new( x / viewPortFrame.AbsoluteSize.X * MapSize - MapSize/2, cameraPart.Position.Y, y / viewPortFrame.AbsoluteSize.Y * MapSize - MapSize/2 ) cameraPart.CFrame = CFrame.new(position) end) viewPortFrame.MouseButton1Up:Connect(function() clicked = false end)This code uses the
MouseButton1Downevent on the minimap to setclickedto true and calculate the position where the camera should be moved. The position is calculated based on the clicked position on the minimap and scaled according to the MapSize. The of the "CameraPart" is then set to the calculated position.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.