Isometric Camera Like In Those Farming Games

Could Someone Help Me How To Make A Isometric Camera That Can Move With Control Keys And The Character Wont Move ( Also How Can I Make It Zoom In And Move )

1 Like

You can’t perfectly achieve this effect. But, you should try decreasing the field of view as much as possible, as well as moving the camera back very far. I don’t know how this will look, but it should look different than normal. It may also mess up some raycasting but I’m not sure. Give it a try!

1 Like

As @bluebxrrybot said, you’ll want to mess with the FOV.

Here’s an example of something I threw together:


HQ Version

LocalScript inside of StarterCharacterScripts:

local fov = 5
local width = 1
local maxParts = 100
local transparency = 0.75

local height = 300
local distance = (10/math.clamp(fov,1,1000)) * height

local runService = game:GetService('RunService')
local character = script.Parent
local root = character:WaitForChild('HumanoidRootPart')
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = nil
camera.FieldOfView = fov

local alive = true
local died
died = character:WaitForChild('Humanoid').Died:Connect(function()
	alive = nil
	died:Disconnect()
	died = nil
	camera = nil
	character = nil
	root = nil
end)

local transparentList = {}

function CameraRaycast()
	local params = OverlapParams.new()
	params.FilterType = Enum.RaycastFilterType.Blacklist
	params.FilterDescendantsInstances = {character}
	params.MaxParts = maxParts
	local cameraPos,rootPos = camera.CFrame.Position,root.Position
	local diff = (cameraPos-rootPos).Magnitude
	local cframe = CFrame.new(camera.CFrame.Position,root.Position) * CFrame.new(0,0,-diff/2)
	cameraPos,rootPos=nil,nil
	return workspace:GetPartBoundsInBox(cframe,Vector3.new(width,width,diff),params)
end

function UpdateList()
	local newList = CameraRaycast()
	for _,obj in transparentList do
		obj[1].Transparency = obj[2]
	end
	table.clear(transparentList)
	transparentList = {}
	for _,part in newList do
		local n = part.Transparency
		table.insert(transparentList,{part,n})
		if n < 1 then
			part.Transparency = transparency
		end
		n=nil
	end
	newList = nil
end

while alive do
	camera.CFrame = CFrame.new(root.Position) * CFrame.new(0,distance,0) * CFrame.Angles(0,math.rad(45),0) * CFrame.Angles(math.rad(-67.5),0,0) * CFrame.new(0,-(37.5/100)*distance,0)
	UpdateList()
	runService.RenderStepped:Wait()
end

This was just something I quickly threw together, but you could probably make it nicer if you wanted to. The only issue is that the smaller the FOV, the more zoomed in it will be. The more zoomed in, the farther you have to move the camera away. The farther you move the camera away, the less likely things are to render properly, especially the lighting as you see there.

5 Likes

thats kind of it but i dont want the player to move but the CAMERA to move (also zoom in and zoom out)

1 Like

You can edit my script to do that or write your own. :+1:

3 Likes

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