Greetings, fellow earthlings.
So, I have coded this top down camera script but for whatever reason it stops the player’s character from moving.
Anti-anti zombie shooter - Roblox Studio (gyazo.com)
As you can see, the player can jump but not move. I got rid of the script and it fixed the movement problem but I needed the top down camera. I tried asking help from other developers but even they couldn’t figure it out since the script wasn’t related to the character’s movement. I’d like to know why this happens and how I can fix it.
wait(2)
--Services
local RunService = game:GetService("RunService")
local player = game:GetService("Players")
--Variables
local cam = workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Scriptable
local players = game.Players.LocalPlayer
local character = players.Character
local CamTopDown = Vector3.new(0,20,0)
--Runs function after each frame
RunService.Heartbeat:Connect(function()
if character then
local torso = character:WaitForChild("HumanoidRootPart")
cam.Focus = torso.CFrame
cam.CFrame = CFrame.new(torso.Position + CamTopDown ,torso.Position)
end
end)