# Pan Follow Camera with Keyboard

Some games just require a camera to follow the ground plane in an isometric style. I have done this with mobile games using the touch screen, but at present that requires some coding. However, for the desktop, this can be achieved quite simply using a few simple Actions and the Game Creator Follow Camera.

For this Tutorial, in addition to Game Creator, you will need the following:

* Move by Distance Action from the Action Pack 1 for Game Creator
* On Key Being Pressed Trigger from the Game Creator HUB.

These can be found at:

<http://u3d.as/1RJN> and <https://hub.gamecreator.io/content/item/HfEBp4iZY83YwI5lbqDK> respectively.

To start, once you have created your terrain or ground plane, you need to decide on the camera angle that suits the style of your game. This is controlled by the placement of two 3D cubes, and you can also adjust them later to suit.

Add a Game Creator Camera Motor and set this to Follow. But before we set the parameters in this motor, we need to add our two Cubes. Add the first cube above the terrain and approximatley where you want the camera to start from.&#x20;

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M92fq-Pc8LSNB16zR7n%2F-M92y2-ipIwySyLYShOf%2Fpic1.png?alt=media\&token=46a70b72-d59d-4195-9fe9-4fc1c7b79b7a)

Add the Second Cube forward and down from the first.&#x20;

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M92fq-Pc8LSNB16zR7n%2F-M92yHveFcSIVtsP-WhM%2Fpic2.png?alt=media\&token=0b8676ee-3858-45e0-b60a-1cad1489c0f4)

Then child the Second cube under the first, so when the First cube is moved, so will the second, but maintain its distance and perscpective.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M92fq-Pc8LSNB16zR7n%2F-M92yansVHovipN_hoqc%2Fpic3.png?alt=media\&token=5863ae13-e557-433d-8cc1-093f576ce7b8)

Next, in the Follow Camera Motor, set the **Anchor** to Game Object and select the Parent Cube, and set the **Look At** to Transform and select the child Cube.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M92fq-Pc8LSNB16zR7n%2F-M92zDS0gVtD4WubDA6i%2Fpic4.png?alt=media\&token=2d417713-626d-4a0d-9e5e-c70fdb0719fa)

You can adjust the view angle by dragging the second cube outwards, and the first cube up or down.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M93-45h1OwfDW6ZMIZa%2F-M93-c_RPtVg9G0wfo6b%2Fclip6.gif?alt=media\&token=76877a6a-3293-4395-93a8-04cea1fbf8da)

Once you have the angle how you want it, its time to make it move. The settings here will depend on your scale, and for this demo I have used an extremley large terrain. The smaller the terrain or ground plain, the smoother it will be.&#x20;

Unclick the Mesh Renderes for both Cubes, so they are not seen, nor is time wasted rendering them

Now we add a Trigger into our scene. Select the **On Key Being Pressed** that you downloaded from the Game Creator HUB. Set it to W (or whatever Key you want for forward), and add an Action. Within the Action, add the **Move Object by Distance** from the Action Pack 1, and add the Parent Cube to the Game Object.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M93029_BMjI8-KCPqxm%2F-M931BC5HkJ7-UrA18dg%2Fpic5.png?alt=media\&token=4f2f75c7-9124-44d1-b9c7-556670dfd2c4)

Select x Axis to Move and set your value. I have set to 100, but on a smaller terrain, 10 should be okay. You can experiment with these later to get your desired effect. Also set the **Easing to Linear,** or you will get some interesting effects.

The last thing to do is to duplicate the Trigger with Action, Change the Key to S, and make the move value in the Move Action negative. Now press play.&#x20;

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-M9332lsHoxnX4_CENWv%2F-M9338tRxMhWglM2tdM5%2Fclip7.gif?alt=media\&token=d956d12a-0cc1-428c-908c-7ef8de4f00de)

My scene is a bit slow as the Terrain I used was extremely large.  A smaller terrain or floor plane will be a lot smoother. You can also tilt the camera more to provide an isometric view of a 2.5d Game.&#x20;

You can also duplicate the Trigger twice more, set the keys to A and D, and move on the y axis. This will move your camera sideways.&#x20;

Have Fun!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://profpivec.gitbook.io/documentation-and-tutorials/tutorials/tutorials-for-game-creator/pan-follow-camera-with-keyboard.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
