Hi,
I’m doing a mini project that’s inspired by crossy road, I want my camera to look like crossy road but I can’t figure out the perfect CFrame for it.
How it looks right now:
How I want it to look:
Here’s the repo if you want to test the camera your self:
repo.rbxl (229.4 KB)
(Go to replicated storage → source → classes → camera, then find Camera.Update OR specifically line 104)
-- all main things that affect the camera
local CameraLocation = Vector3.new(0, 0, -20)
local FieldOfView = 60
--/ update the camera (runservice)
function Camera.Update(self: ClassType, deltaTime): ()
if not self.character then
return
end
local Primary = self.character.PrimaryPart :: BasePart
if not Primary then
return
end
CameraLocation = Vector3.new(
Primary.Position.X,
CameraLocation.Y,
math.max(CameraLocation.Z , Primary.Position.Z)
)
CurrentCamera.CameraType = Enum.CameraType.Scriptable
CurrentCamera.FieldOfView = FieldOfView
CurrentCamera.CFrame =
CFrame.new(CameraLocation + Vector3.new(-15 , 50 , -40) , CameraLocation)
* CFrame.Angles(math.rad(10), 0, 0)
SoundService:SetListener(Enum.ListenerType.ObjectCFrame, Primary)
end
Thank you.