How would I go about making a Bloxburg-like Click to enter camera movement?

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…

7 Likes

If your asking for an entire script I don’t think anyone will respond.

4 Likes

If not so, at least I could be provided with a tutorial, or maybe some sort of Explanation.

4 Likes

The game is copyright, if you do anything with the same system your game will be taken down and may go to jail or Curt!

I’ll break it down for you as much as i can:

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)

like so:

local MouseDelta = NewMousePosition - OldMousePosition

Cam.CFrame = Cam.CFrame * CFrame.Angles(0,math.rad(MouseDelta.X), math.rad(MouseDelta.Y))

You only change the rotation when the right mouse button is pressed.
That’s the basic idea of it

6 Likes