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

Camera CFrame Tweening ? Unable to cast to Object

Asked by 4 years ago

Hello I am trying to make When Gun Is shot it Recoil's the Camera and I want it to go back to old camera position I tried like this but it gives an error: Unable to cast to Object and I cannot find the solution.

    local TweenService = game:GetService("TweenService")
    local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out)
local OldPos = cam.CFrame
TweenService:Create(cam.CFrame,tweenInfo,{Position = OldPos})

Answer this question