Camera not rotating correctly

Been trying to make my Camera rotate to look at a part using tween but for some odd reason it doesn’t face the designated part.

Now when I use Camera:Interpolate() it works but this is said to be Depreciated.

Here is the code below anyway I can get this to rotate correctly to face the part is needs to face?

--Tween Animation For Camera--
Camera.CameraType = Enum.CameraType.Scriptable

local TweenInfoAnimation = TweenInfo.new(
    1,
    Enum.EasingStyle.Cubic,
    Enum.EasingDirection.InOut,
    0,--Reverses
    false,
    0--Delay
)

local TweenInfo1 = {
    Focus = CFrame.new(workspace.Part1),
    FieldOfView = 100				
}

local Tween1 = TweenService:Create(Camera,TweenInfoAnimation,TweenInfo1)

Tween1:Play()
1 Like

Could you explain the primary goal of “Focus”? What’s the intention of using focus? Are you trying to get the Camera to face the part from its current position?

Edit:

To make the Camera face the part, you can simply change the CFrame property of the Camera.

local TweenInfo1 = {
    CFrame = CFrame.new(Camera.CFrame.Position, workspace.Part1.Position),
    FieldOfView = 100				
}

Smh thanks bro I knew this already I was trying to do things that were harder than it needed to be :man_facepalming:

1 Like

Ended up just using

CFrame.new(Camera.Position) * CFrame.fromOrientation(math.rad(#1),math.rad(#2),math.rad(#3))

Due to the fact that what we used earlier kept breaking my tween so I had to code differently but thanks. :+1:

1 Like