Camera prevents player movement

Continuing the discussion from How to make a top-down camera view?:

I’m trying to use this top down camera script for my game, but when I enable the script, the player just can’t move. Why is this?

I don’t see anything in that script posted in the solution that should affect the movement of the character.

Have you tried disabling it and see if it affects the movement? Maybe something else is affecting the movement in another script.

when I enable the camera script, the player stops moving, but when I disable it, the player moves fine

It’s the second script btw

I’m not sure why he made it a little bit complicated but here is the updated version/cleaner version. Not sure if this will work though I just cleaned it up a little bit and there were some deprecated things the person that posted the solution was using (Probably because it’s from 2023)

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

local playerChar = Player.Character or Player.CharacterAdded:Wait();
local playerHRP = playerChar:WaitForChild("HumanoidRootPart");
local camera = game.Workspace.CurrentCamera;
local StudsY = 20;

camera.CameraType = Enum.CameraType.Scriptable

RunService.PreRender:Connect(function()
	camera.CFrame = CFrame.new(playerHRP.Position.X,StudsY,playerHRP.Position.Z) * CFrame.Angles(math.rad(-90),0,0);
end)
1 Like

your script did work but I still couldn’t move
I still do thank you for the cleaner script though. the problem wasn’t the code but the area of which the script was in
(i had to put it in startercharacterscripts for some reason)