Set camera to be on level with player character

I’m working on a collectathon platformer and I want to make the camera to tilt down to the player’s level when they collect an item to display an animation better and avoid it looking like this:
dontWantThis

I’m using tween service to move the camera but when trying to set the camera’s CFrame, how ever it always changes both the position and orientation of the camera instead of just tilting the camera down. So far I’ve been setting up the tween goal like this.

{CFrame = CFrame.new(camera.CFrame.X, math.rad(5), camera.CFrame.Z)}

Looking at other dev forum posts all suggest multiplying the current camera CFrame by an offset but everytime I’ve tried that it’s usually only moves the camera by a set amount rather than moving it to the exact angle I want it to always move to.

Try setting the cameras type to be scriptable

Figured it out. I created a temporary part for the camera position and used the player’s root part for the camera’s look at

local tempPart = Instance.new("Part")
		tempPart.Transparency = 1
		tempPart.CanCollide = false
		tempPart.Anchored = true
		tempPart.Parent = game.Workspace
		tempPart.CFrame = rootPart.CFrame * CFrame.new(0,0,-15)
		
		local cameraLookAtTween = tweenService:Create(camera, tweenInfo, {CFrame = CFrame.new(tempPart.CFrame.Position, rootPart.CFrame.Position + Vector3.new(camera.CFrame.LookVector.X, 0, camera.CFrame.LookVector.Z))})

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.