Lock camera at a 2.5D angle

Hey! My goal is to lock the camera at a 2.5D-ish perspective, kinda like these images.


I’ve tried locking the camera and making it LookAt() something in front of the player, but I wasn’t able to get the tilt to work, nor did the Camera actually lock.

1 Like

I think you want to make this little script:

-- Services
local PlayerService = game:GetService("Players")
local RunService = game:GetService("RunService")

-- Variables
local Player = PlayerService.LocalPlayer

local CurrentCamera = workspace.CurrentCamera

local Angle = -32

-- Initialize CameraType
CurrentCamera.CameraType = Enum.CameraType.Scriptable

-- Connections
RunService.RenderStepped:Connect(function()
	if Player.Character then
		local humRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
		if humRootPart then
			CurrentCamera.CFrame = CFrame.new(humRootPart.Position + Vector3.new(0, 11, 20)) * CFrame.Angles(math.rad(Angle), 0, 0)
		end
	end
end)

Put the code on a LocalScript.

If you have any questions, don’t hesitate to ask me!

Yes!!! Thank you!!! I altered it a little bit, I don’t know how to send videos, but this is amazing.

local RunService = game:GetService("RunService")

-- Variables
local Player = PlayerService.LocalPlayer
local CurrentCamera = workspace.CurrentCamera
local Angle = -50

-- Cause Camera Lag :3
local lagFactor = 0.04 -- change to adjust lag!!!! (1=No Lag, 0 = Broken, 0.01 = Lot of lag)

local lastPosition = Vector3.new()
local lastRotation = CFrame.new()

CurrentCamera.CameraType = Enum.CameraType.Scriptable

RunService.RenderStepped:Connect(function(deltaTime)
	if Player.Character then
		local humRootPart = Player.Character:FindFirstChild("HumanoidRootPart")
		if humRootPart then
			local targetPosition = humRootPart.Position + Vector3.new(0, 20, 15)
			local targetRotation = CFrame.Angles(math.rad(Angle), 0, 0)


			lastPosition = lastPosition:Lerp(targetPosition, lagFactor)
			lastRotation = lastRotation:Lerp(targetRotation, lagFactor)


			CurrentCamera.CFrame = CFrame.new(lastPosition) * lastRotation
		end
	end
end)```

Nice it looks like the issue has been resolved with the solution provided. If you agree, could you please mark my response as the solution? This will help other community members know that the topic has been resolved.

If you have any further questions or if there’s anything else I can assist you with, feel free to let me know.

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