MMORPG Top-Down View

Hello everyone

I’m currently working on a big project (MMORPG) and I need some help with some sort of
top-down view. I’m not experienced in coding at all but I’m definitely hiring in the future.
I have worked out most of the issues with UI etc. Basically, to put it short I need help for a top-down camera (I have tried youtube and you can still move the camera around but then it snaps back into to top-down and I also can zoom in so I’m asking here because the ones on YT don’t work) If I could get any info on this I would be overjoyed.

Thanks, Regards
Leave1001

2 Likes

Note this is a rough code as I’m not at my computer at the moment:

LocalScript in StarterBackpack or StarterGui.

Local Camera = workspace:WaitForChild("Camera")

Local Player = game:GetService("Players").LocalPlayer

Local YOffSet = 10

Game:GetService("RunService").RenderStepped:Connect(function()

if Camera then
Camera.CameraType = "Scriptable" 
Camera.CFrame = CFrame.new(Player.Character:WaitForChild("HumanoidRootPart").CFrame.p + Vector3.new(0, YOffSet, Z), Player.Character:WaitForChild("HumanoidRootPart").CFrame.p)
end

end)
1 Like

I not working I put it in StarterBackpack, StarterGUI, Starterplayerscript, ETC.
Are you sure you put the right piece of code?

Fixed your code up a bit, it should work now.

local Camera = workspace.CurrentCamera

local Player = game:GetService("Players").LocalPlayer

local YOffSet = 10

game:GetService("RunService").RenderStepped:Connect(function()
	if Camera then
		Camera.CameraType = Enum.CameraType.Scriptable
		Camera.CFrame = CFrame.new(Player.Character:WaitForChild("HumanoidRootPart").CFrame.p + Vector3.new(0, YOffSet, 0), Player.Character:WaitForChild("HumanoidRootPart").CFrame.p)
	end
end)
2 Likes

You probably shouldn’t keep setting the camera to scriptable every frame. You should only do it once at the start of the script.

1 Like

Thanks Its perfect But is there a slim chance you could make the code so it will stay on its angle but you could spin the camera? If so it would be much appreciated!