Skip to content

Fix: Draw Gizmos in the same frame they are created (by moving update_gizmo_meshes to run in PostUpdate)#22802

Open
kfc35 wants to merge 2 commits intobevyengine:mainfrom
kfc35:22438_gizmo_single_frame_render
Open

Fix: Draw Gizmos in the same frame they are created (by moving update_gizmo_meshes to run in PostUpdate)#22802
kfc35 wants to merge 2 commits intobevyengine:mainfrom
kfc35:22438_gizmo_single_frame_render

Conversation

@kfc35
Copy link
Contributor

@kfc35 kfc35 commented Feb 4, 2026

Objective

Solution

  • The problem in the issue seems to be that one frame gizmos have their asset added to Assets<GizmoAsset> in the Last schedule, which executes after AssetEventSystems in PostUpdate. This causes their extraction to be delayed one frame, which means they don’t get rendered. You can read my investigation notes in the issue for a detailed look.
  • This relatively simply solution (which may be contentious? if the previous scheduling is very intentional) is to simply move the updating of gizmo meshes to be before AssetEventSystems in PostUpdate. This ensures that messages of any new assets is received by the extractor and therefore rendered in the same frame.

Testing

The reproduction code in #22438 now works as desired. After removing the gizmo that gets drawn every frame (by pressing d), pressing A or S for either of the single frame gizmo correctly renders them.

@kfc35 kfc35 added A-Gizmos Visual editor and debug gizmos D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Bug An unexpected or incorrect behavior labels Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Gizmos Visual editor and debug gizmos C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gizmos render unreliably

1 participant