I'm trying to make the camera brick move forward,backwards,etc when a button is pressed.
I'm not exactly sure where the error is.
Player = script.Parent.Parent mouse = Player:GetMouse()
local var = game.Workspace.Cam local value = script.Parent.Value local x,y,z = value.x,value.y,value.z
function Forward1() x = x - 5 end
function Forward2() x = x + 5 end
function Forward() z = z - 5 end
function Forward3() z = z + 5 end
function onKeyDown(key) key = key:lower()
if key == "w" then
Forward()
end
if key == "a" then
Forward1()
end
if key == "s" then
Forward2()
end
if key == "d" then
Forward3()
end
end
mouse.KeyDown:connect(onKeyDown)

3 comments
Weird, my message glitched.
Fix it maybe?
Try using the CameraSubject instead.