So I want to create a perfect Bloxburg-like building system, and am taking help for parts individually.
So the first thing that I would like to achieve is how, the player enters the Building Mode and has his camera manipulated in the position where it can see his area, and build and just move around his camera using WASD moving controls just like this game (Bloxburg) has…
Camera controls:
when you press W,A,S or D make the change in CFrame relative to the camera’s current rotation.
What this means is this:
for example, when D or A is pressed, we want to work with the RightVector component of the CFrame since it deals with right / left movement.
onKeyPressed(Key)
if Key = 'A' then
cam.CFrame = Cam.CFrame * Cam.CFrame.RightVector * -1
elseif Key = 'D' then
cam.CFrame = Cam.CFrame * Cam.CFrame.RightVector * 1
elseif Key = 'W' then
cam.CFrame = Cam.CFrame * Cam.CFrame.LookVector * 1
elseif Key = 'S' then
cam.CFrame = Cam.CFrame * Cam.CFrame.LookVector * -1
end
end
This is very rough code, there’s better ways to do this via dictionaries etc.
Rotating the camera is a different story, you need to check for the delta of the mouse (the change of the mouse’s position)