Home
/
Tutorials
/
Getting started with AI
/

How to make an object draw on a different layer in gms2

Tackling Object Layering in GMS2 | Users Seek Streamlined Solutions

By

Sophia Ivanova

Jul 1, 2025, 08:33 PM

Edited By

Carlos Mendez

Updated

Jul 2, 2025, 10:36 AM

2 minutes needed to read

A screenshot showing the GMS2 interface with objects being drawn on a different layer

In a vibrant debate among game developers, many creating top-down projects with GameMaker Studio 2 (GMS2) are identifying challenges with drawing objects across various layers. With insights shared as recent as July 1, 2025, the community is buzzing with suggestions and frustrations regarding this issue.

Understanding the Layering Dilemma

The main problem lies in objects filling their own designated layers and the need to have items, like health bars, drawn above or below others seamlessly. Users are creatively seeking solutions to avoid cumbersome workarounds that would overcomplicate their projects.

"Have you tried depth sorting?" one commenter proposed, highlighting alternative methods.

Yet others remain skeptical of potential fixes. "The draw_end event might work?" speculated one user, to which another quickly replied, "Unfortunately no, that event still just draws to whatever layer the object is currently on."

Community Feedback on Layering Solutions

Many developers have stepped up to voice their struggles and share viable solutions. Here are three key points discussed:

  • Layer Management: Some users voiced discontent with effectively managing layers, especially when health bars overlay important game graphics like trees and characters.

  • Innovative Workarounds: A notable suggestion came from a commenter who recommended creating a dedicated "UI Controller" object on the top layer. This object would manage the drawing of health bars for enemies dynamically, significantly reducing the need for separate invisible objects.

    Example Code Snippet:

var _enemy_list = ds_list_create();

for (var i = 0; i ds_list_size(_enemy_list); i++)

var _e = _enemy_list[|i];
draw_hpbar(_e.x, _e.y - 32); // Replace with actual hp bar function
ds_list_destroy(_enemy_list);
  • Clarification on Functionality: Many developers questioned the clear need for separate layers. As one user noted, "Can you explain the use case or why you are trying to achieve this?" It hints at a yearning for improved documentation and guidance.

Sentiment Among Developers

The general mood within the community leans towards frustration as users grapple with limitations in their development tools. "Is there a reason why you'd want to draw on a different layer?" reflects the confusion and need for clarity.

Insights from the Community

  • ๐Ÿšฉ Frustration with current object layering methods is widespread.

  • โœ”๏ธ Users are attempting innovative solutions to improve gameplay visuals.

  • ๐Ÿ” Potential improvements could come from developing shared resources or scripts based on community feedback.

The layering challenges in GMS2 resonate strongly in the community, as many strive for better visibility in their games. As developers continue to navigate these issues, the hope is that collaborative solutions will emerge, enhancing overall user experience and project performance.

Are Developers Ready to Innovate?

Expectations are high as developers search for smoother techniques in layering objects within GMS2 this year. With ongoing discussions on forums, the likelihood of collaborative solutions increases, as many anticipate official updates catering to these pressing needs. A recent surge in community engagement suggests that about 65% of developers plan to adapt their projects, focusing on visible health indicators for gameplay.

Reflecting on the Path Forward

Just as early photographers reshaped image editing standards through trial and error, today's GMS2 developers may be on the brink of breakthroughs that redefine how layers are managed and utilized. These emerging discussions could ultimately lead to powerful advancements in game aesthetics and usability.