I would like some help with interpolating my camera. I'm currently creating a dialog GUI where it would interpolate the camera looking to the position of the person I am talking with. Currently, I base the position of the camera by 2x the distance of the person and my own character using :Lerp. This works fine unless the player speaks to the person at a very close distance (touching distance), where my player would not be able to be seen. This is a GIF of it:
https://gyazo.com/ffc136ea6220fce2200450c1e4c3af77
This is my current code:
function dialog:FocusTo(position)
CurrentCamera.CameraType = Enum.CameraType.Scriptable
local cframe = RootPart.CFrame
local point = position:Lerp(cframe, 2) * CFrame.new(0,4,4)
CurrentCamera:Interpolate(point, position, 0.4)
end
I am very bad at vector maths, so what I want to do is to have the camera positioned 2x the distance between the person and the character, plus a fixed 20 studs so both the person and the character can be seen while talking. How can I add that 20 studs?

10 comments
I am not sure why you are using Lerp? CurrentCamera:Interpolate() is all you need
It's to get the CFrame value of twice the distance of the character and the part.
This would just return *2 the RootPart.CFrame https://developer.roblox.com/articles/Lerp
You can get the distance between the npc and character by using (player.Position - npc.Position).Magnitude * 2 https://developer.roblox.com/articles/Magnitude
Using Lerp works too.. as evident in the GIF.
It would stick to using the functions build for the task. Yes it is possible to do this all with lerp and the run service.
Anyways, this is an illustration of what I want to achieve: https://gyazo.com/1fc264f260ac428a895d344425f86c61. I just need help on how to add that 20 studs.
This is just a guess. RootPart.CFrame * CFrame.new((RootPart.CFrame.lookVector * -1) * ((RootPart.CFrame.p - npc.Position).Magnitude * 2) +20))
Got this error for that: 01:28:39.804 - Players.Rheines.PlayerGui.Dialog.LocalScript.Dialog:59: bad argument #2 to '?' (Vector3 expected, got number).
I would be able to help you more in SH chat.