I need a way for the camera to follow the player but with an above-view perspective
the camera has above-view perspective, but it won’t move
here is the script I’m using: (sorry it’s pretty bad)
local UIS = game:GetService("UserInputService")
wait(5) -- haven't replaced with waitforcharacter
while true do
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
local pos = Vector3.new(0, 50, 0)
local lookAt = Vector3.new(0, 0, 0)
local cameraCFrame = CFrame.new(pos, lookAt)
workspace.CurrentCamera.CFrame = cameraCFrame
UIS.InputBegan:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.W then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
pos = pos + Vector3.new(100,0,0)
lookAt = pos
end
end
end)
UIS.InputBegan:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.S then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
pos = pos - Vector3.new(100,0,0)
lookAt = pos
end
end
end)
UIS.InputBegan:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.A then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
pos = pos - Vector3.new(0,0,100)
lookAt = pos
end
end
end)
UIS.InputBegan:Connect(function(input,GPE)
if input.UserInputType == Enum.UserInputType.Keyboard then
if input.KeyCode == Enum.KeyCode.D then
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
pos = pos + Vector3.new(0,0,100)
lookAt = pos
end
end
end)
end