Skip to content

Depth effect

Change scale based on Y position to simulate depth of field.

Authors and contributors to this community extension: VictrisGames.


The scale of the object decreases the closer it is to the horizon, giving the illusion that the object is travelling away from the viewer.

Properties:

  • Horizon Y position (Default: 0)
  • Max scale of the object when it is at the bottom of the screen (Default: 1)
  • Y exponent can be used to control the rate of change (Default: 2)

Tips:

  • If you want speed to look constant, be sure to reduce the object's speed based on scale or Y value. If you don't do this, the object will appear to be moving faster when it is near the top of the screen. This matches how objects appear in the real world.
  • This extension works well with the Y-sort extension, which changes Z order based on Y position.

Read more...


Tip

Learn how to install new extensions by following a step-by-step guide.

This page is an auto-generated reference page about the Depth effect extension, made by the community of GDevelop, the open-source, cross-platform game engine designed for everyone. Learn more about all GDevelop community-made extensions here.