godot icon indicating copy to clipboard operation
godot copied to clipboard

CanvasGroup culls (disappears) too early

Open Atlinx opened this issue 9 months ago • 1 comments

Tested versions

v4.2.2.stable.official [15073afe3]

System information

Windows 10 - v4.2.2.stable.official [15073afe3]

Issue description

A CanvasGroup node that overlaps a _draw call culls itself (disappears) early when a Camera2D zooms out.

https://github.com/godotengine/godot/assets/25368491/0270e220-0312-4289-b47a-712ae12512c7

Steps to reproduce

  1. Open MRP project
    • There are two sprites in a 2D scene
    • The sprite on the left is a normal sprite
    • The sprite on the right is red, and is a child of a CanvasGroup node
    • A 2D grid covering the entire screen is made using a _draw call
  2. Zoom out with camera
  3. Notice how the sprite under the CanvasGroup node disappears when you zoom too far out

Minimal reproduction project (MRP)

CanvasGroupBug.zip

Atlinx avatar May 13 '24 22:05 Atlinx

Oddly enough, setting Y Sort Enabled = true on the canvas group fixes this issue.

EDIT: Ah, but enabling Y-sort disables the canvas group behavior altogether, therefore there's no workaround.

Atlinx avatar May 13 '24 22:05 Atlinx