Step 1

Snapping the camera

You've probably noticed that the character flies outside of the game screen.

To keep the game screen following the character, we need to script it to make the camera follow along. Right-click on the character script, and grab the "pan camera to" block from under Looks. Drag it out into the workspace, and change pan to snap by clicking on the arrow next to pan.

The x and y numbers on this block will tell the camera to snap to those x and y positions in the level. As the character flies further to the right, the character's x position will get larger and larger. We want the camera to snap to the x position of the character, so we need to find a block that will give us the character's position, and then put that block inside the x number in the camera block. The block we need is under Transform, and is named "x position of myself".

Replace the number "0" x from the camera block with the "x position of myself" block. Myself means whatever game object that this script is attached to, so in this case myself is referring to the character. (You can drag the 0 block into the trash since we don't need it now).

results matching ""

    No results matching ""