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

Why can I not use lookvector when using interpolation?

Asked by 4 years ago
Edited 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, 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)
> `  18:15:43.618 - Unable to cast Vector3 to CoordinateFrame
> 18:15:43.619 - Stack Begin
> 18:15:43.619 - Script 'Players.Thesquid13.PlayerGui.LocalScript', Line 8
> 18:15:43.620 - Stack End`
0
because `player.Character.Head.CFrame.LookVector` is a Vector3, not a Cframe theking48989987 2147 — 4y
0
camera:Interpolate(player.Character.Head.CFrame, CFrame.new(player.Character.Head.CFrame.LookVector), 1) Fifkee 2017 — 4y

Answer this question