I am currently writing a third person camera. This is what it looks like now: https://gyazo.com/c631c83fae14937b3ae9f60b67eadb0d
I want to add smooth camera motion. The formula being:
local Alpha = 0.1
Position += (Target - Position) * Alpha
However, when I do this, I get this: https://gyazo.com/bb05120e684291eea3df50a20bc47356
Here is the code in RenderStepped:
local TargetPosition = Camera.CFrame.Position + (HumanoidRootPart.Position - Camera.CFrame.Position) * 0.1
local StartCFrame = CFrame.new(TargetPosition) * CFrame.Angles(0, math.rad(AngleX), 0) * CFrame.Angles(math.rad(AngleY), 0, 0)
local CameraCFrame = StartCFrame + StartCFrame:VectorToWorldSpace(OFFSET)
local CameraFocus = StartCFrame + StartCFrame:VectorToWorldSpace(Vector3.new(OFFSET.X, OFFSET.Y, 0))
Camera.CFrame = CFrame.new(CameraCFrame.Position, CameraFocus.Position)
I am not the best with CFrame math. Any help is appreciated!