I want to make my own custom game not using the official Roblox movement I have made my own camera turn but I want to make the camera move. Pressing “W” would make you move in the direction you are facing in.
I searched the dev forum but nothing was what I wanted…
here is the game if you want to see what I tried: My custom roblox game - Roblox
this is my camera turn and move script:
local Mouse = game.Players.LocalPlayer:GetMouse()
local UserInputService = game:GetService("UserInputService")
local MouseX = 0
local MouseY = 0
local CamPart = game.Workspace.Player.CameraPart
while wait() do
game.Workspace.Camera.CameraType = Enum.CameraType.Scriptable
game.Workspace.Camera.CFrame = game.Workspace.Player.CameraPart.CFrame
MouseX = Mouse.X * -0.7
MouseY = Mouse.Y * -0.35 + 55
game.Workspace.Player.CameraPart.Orientation = Vector3.new(MouseY,MouseX,0)
UserInputService.InputBegan:Connect(function(Input)
if Input.KeyCode == Enum.KeyCode.W then
repeat wait()
local lv = game.Workspace.Player.CameraPart.CFrame.LookVector
local cf = game.Workspace.Player.CameraPart.CFrame
game.Workspace.Player.CameraPart.CFrame = cf + lv * Vector3.new(0.05,0.05,0.05)
until UserInputService.InputEnded == Enum.KeyCode.W
end
end)
end