Skip to content

New extension: Dynamic Camera - #2285

Open
github-actions[bot] wants to merge 1 commit into
mainfrom
extension/NicolasDemangeat/2284
Open

github-actions[bot] wants to merge 1 commit into
mainfrom
extension/NicolasDemangeat/2284

Conversation

@github-actions

@github-actions github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a FrameCameraOnObjects action that moves and zooms a camera so every instance of a given object or group stays inside the view, with padding, a minimum visible size, and smooth interpolation toward the target.

Each call:

  1. Computes the bounding box of every instance of the object (or group) passed in
  2. Centers the camera on the middle of that box
  3. Picks a zoom level that fits the whole box on screen, with your chosen padding
  4. Smoothly interpolates the camera's position and zoom toward that target, instead of snapping instantly

No JavaScript involved, the whole extension is built with regular GDevelop events, so it's easy to inspect, tweak, or extend.

How to use the extension

Call FrameCameraOnObjects every frame to keep a changing set of objects in view automatically, instead of a fixed camera on the whole level. Useful for:

  • A construction or crafting game where the camera should follow the current build
  • A strategy game following a group of selected units
  • Any scene where the important area shrinks or grows over time

Setup:

  1. Create an object group containing everything the camera should keep in view (e.g. units, or a building + its target)
  2. Each frame, call FrameCameraOnObjects(Objects, Layer, Padding, MinVisibleSize, Smoothing, MinZoom, MaxZoom)
  3. Tune Padding and MinVisibleSize so the view doesn't feel too tight or too empty
  4. Tune Smoothing for how quickly the camera catches up — higher is snappier, lower feels more floaty
  5. Set MinZoom / MaxZoom as safety bounds so the camera never zooms in or out past what looks good in your game

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

AI usage

  • I used an AI to generate some part of the code.
  • I don't understand the generated code or I don't feel able to modify it.

Example file

DynamicCamera-Example.zip

Extension file

DynamicCamera.zip


Extension by @NicolasDemangeat

You can update the extension on this "Pull Request" by commenting the update command: in the comment field, type !update, then drag and drop a zip file with your extension file in the commenting field, like how you initially submitted the extension. It should look like this:

!update [MyExtension.zip](https://github.com/GDevelopApp/GDevelop-extensions/files/12709661/MyExtension.zip)

It can take a few seconds for the file to fully upload and show as the above. Once it is like shown above, click "Comment" and let the bot do the rest!

@github-actions
github-actions Bot requested a review from a team as a code owner October 1, 2026 12:43
@github-actions github-actions Bot added the ✨ New extension A new extension label Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✨ New extension A new extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant