Hello, I am new to the community here. I have been recently been working on a game where I have a sphere that is the player. I made it so that you could view the player from perfect top down. Unfortunately, when I did this the player stopped moving with WASD keys. I noticed that as soon as I change the Vector3 to not point the CFrame all the way down the character moves again but in a diagonal and inverted way.
Here's my code:
print("Intalized Camera Script")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local OFFSET = Vector3.new(0, 400, 0)
local FOV = 30
local player = Players.LocalPlayer
local camera = game.Workspace.CurrentCamera
camera.FieldOfView = FOV
local function onRenderStep()
local character = player.Character
if character then
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if humanoidRootPart then
local playerPos = humanoidRootPart.Position
local cameraPos = playerPos + OFFSET
camera.CoordinateFrame = CFrame.new(cameraPos, playerPos)
end
end
end
RunService:BindToRenderStep("Camera", Enum.RenderPriority.Camera.Value, onRenderStep)
I followed the Roblox Wiki tutorial and modified it to fit my needs. I have been searching for hours for answers. Maybe I am blind and can't read or I am finding nothing.
Basically I need help composing a script that will allow my player to move by following the direction the mouse is pointing on the screen. I am trying to keep my view to be perfectly looking straight down.
Please note that I am new to Lua completely and am not looking to be spoon fed the script. But please be as detailed as possible so I can learn :D.
Thanks!

2 comments
Thank you so much. That works! But for some reason it only works in the studio and not as a published game
You should put this in a local script inside StarterGui or somewhere else that is individual to each player.