I’ve been working on a game recently and it’s a sort of 2d game with a bit of a mix with 3d.
Anyways, what i want to tell you guys is that i’m stuck at a problem. Or atleast, i have no idea how i should make something what i want to achieve.
But what do i want to achieve?
You can see it by the title, i want it that the camera moves with your mouse.
But, i already have a script (Down here) located in StarterPlayerScripts that makes the camera view 2D and locked. (Check this video out to see what i mean). So in short; I want to add an extra feature to make the camera move a bit with your mouse
I hope someone could help me
(Sorry if it’s very unclear, explaining isn’t really my best thing)
-- This is the 2D view script
local player = game.Players.LocalPlayer
local camera = workspace.CurrentCamera
local RunService = game:GetService("RunService")
player.CharacterAdded:Wait()
player.Character:WaitForChild("HumanoidRootPart")
camera.CameraType = Enum.CameraType.Attach
camera.FieldOfView = 40
camera.DiagonalFieldOfView = 67
camera.MaxAxisFieldOfView = 72
RunService.Stepped:Connect(function()
camera.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position) * CFrame.new(0, 5, 30)
end)
Yes but the controls are wrong, because when i press D, i walk forward. S i walk to the right. A i walk back (So to the camera) and with W i walk to the left, which is not good. But the script is good, except the movement is wrong.
Edit: Nevermind! I just needed to delete the old script!
Thank you for your help! You really helped me with this!