(solved) Above view camera movement help

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
local Game = game
local Workspace = workspace
local RunService = Game:GetService("RunService")
local Players = Game:GetService("Players")
local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Camera = Workspace.CurrentCamera

local function OnRenderStep()
	local Pivot = Character:GetPivot().Position
	Camera.CFrame = CFrame.lookAt(Pivot + Vector3.new(0, 30, 1), Pivot)
end

RunService.RenderStepped:Connect(OnRenderStep)

Increase/decrease ‘30’ depending on the camera’s desired height (above the local player’s character).

2 Likes

Thank you! but there is one problem, when you die the camera doesn’t follow you anymore

Did you place the script inside the ‘StarterCharacterScripts’ container?