Skip to content

Moving Camera with the Player – GDevelop

·

In the previous lesson, we learned how to flip an object in
GDevelop. In this lesson we are going to learn how to set up camera to follow
the player. As you all know, in platformer games, the player moves long way
beyond the screen. So always the camera is focused on the player. Otherwise we
won’t see the player when it moves beyond the screen. So the main focus point
of the camera is player. This can be achieved very easily in GDevelop.

Step 1

Add new empty event. We don’t need a condition for this
event. We only need to add an action here. Now go to add action and search for “Center
the camera on an object”.
Select “Bob” as the object. Because “Bob” is our
player. Leave the other settings as defaults. Click OK to add the
action.
And that’s it. It’s simple. Your event should look like this

Ok, you may be wondering how my screenshots went dark. Well,
there’s a dark mode available in GDevelop. If you like to activate it, go to File
> Preferences
from the menu. Then in the popup, under PREFERENCES tab
set the UI Theme to Dark and Code editor Theme (this is
optional)
to Visual Studio Dark. Close the popup and you have dark
theme activated GDevelop.

In the next tutorial, we will learn how to create a “Jump
Through” platform.

Feel free to ask any question regarding this lesson in the
comment section below.