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.
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)
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)
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!