I'm trying to create a script that makes the camera look down on your character from above, from a bird's eye view. My method is to create a part that looks down on your character and set the camera's CoordinateFrame to that part.
Although the camera gets placed in the correct position, my character will not move when I press either WASD or the arrow keys.
My character does have the ability to move, that is, I can set the WalkToPoint manually and my character will walk around. It will not, however, move when I use the buttons on my keyboard.
There are no errors in the output. All answers are appreciated.
The following is a LocalScript inside StarterGui.
local cam = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
local chr = plr.Character
local torso = chr:WaitForChild("Torso")
--Part
local part = Instance.new("Part",chr)
part.Size = Vector3.new(1,1,1)
part.Anchored = true
part.Transparency = 1
part.CanCollide = false
part.Name = "CameraControlPart"
--Set camera
cam.CameraType = "Scriptable"
cam.CameraSubject = chr:WaitForChild("Humanoid")
--Main loop
game:GetService("RunService").RenderStepped:connect(function()
--Part CFrame
part.CFrame = CFrame.new(
Vector3.new( --Position
torso.Position.x,
torso.Position.y + 10,
torso.Position.z),
torso.Position --Look at
)
--Camera CFrame
cam.CoordinateFrame = part.CFrame
end)

1 comment
That works, and you're right, it's a better method, but why does setting the camera directly above the character make him/her get stuck?