Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why isn't lookvector and interpolation working as intended?

Asked by 4 years ago
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local UIP = game:GetService("UserInputService")


UIP.InputBegan:Connect(function(Key)
    if Key.KeyCode == Enum.KeyCode.E then
        camera:Interpolate(player.Character.Head.CFrame, CFrame.new(-player.Character.Head.CFrame.LookVector), 1)
    end
end)

workspace.Part.ClickDetector.MouseClick:Connect(function()
    camera.CameraType = Enum.CameraType.Scriptable
    camera:Interpolate(workspace.watcher.CFrame, workspace.Part.CFrame, 1)
end)

My problem here is that, I want the camera to interpolate back into the player while focusing in the lookvector when you are exiting the prompt. But it won't work. Help?

Answer this question