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
CameraPartmove to the location where you click on the minimap, you can use theMouse.Button1Downevent and theCameraPart.CFrameproperty. Here's an updated version of the code: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 bound = MapGUIsize * MapSize / 2 local posX = math.clamp(x, -bound, bound) local posY = math.clamp(y, -bound, bound) local cameraPart = game.Workspace.CameraPart cameraPart.CFrame = CFrame.new(posX, cameraPart.Position.Y, posY) end end)
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.