I have this script that i would want so if i click on a script it opens a gui that you can click on and the camera goes to that object the mouse is over when you click the gui but i want it so the camera goes to the object you clicked on not the object the camera is over when you click the gui,
heres the script
Mouse.Button1Down:connect(function() if Mouse.Target then if Mouse.Target.Parent:IsA("Model") and Mouse.Target.Name == "Hitbox" then local TargetPos = workspace.CurrentCamera:WorldToScreenPoint(Mouse.Target.Position) UI.Frame.Visible = true UI.Frame.Position = UDim2.new(0,TargetPos.X,0,TargetPos.Y) targeting = Mouse.Target.Parent UI.Frame.Sample.MouseButton1Click:connect(function() workspace.CurrentCamera.CameraSubject = Mouse.Target UI.Frame.Visible = false end) --script.Parent.Frame.ItemName.Text = Mouse.Target.Parent.Name else UI.Frame.Visible = false end else UI.Frame.Visible = false end end)