Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: enable y-sort with Smoothing2D #35

Open
wants to merge 2 commits into
base: 4.x
Choose a base branch
from

Conversation

hunterloftis
Copy link

@hunterloftis hunterloftis commented Jun 24, 2023

Resolves #31

I was glad to see someone had already written a lovely timestep interpolation addon - thanks for publishing this. I found that I couldn't integrate Smoothing2D into my 2D Godot 4 project, however, because:

  1. I rely on y-sorted 2D rendering and
  2. The structure of my game relies on several physics bodies, like Character2Ds, as scene roots

It would have taken a fair amount of work to split all the visuals of the physics entities into siblings, rather than children, as currently recommended to work around the addon's incompatibility with y-sort. It also would have made the game's structure more complicated to work on.

With this change, the addon becomes compatible with y-sort without users needing to change node trees.

@lawnjelly
Copy link
Owner

lawnjelly commented Jun 26, 2023

See #29 . This was actually the old behaviour before using set_as_toplevel, if I remember right. Only for the reason that when I originally wrote the addon 4 years ago, I didn't know toplevel existed. 😁

I think for this I may have to recheck whether the y-sorting with top level is actually something that should be fixed in the core engine, rather than working around in the addon.

Just re-reading my old post on this, if the global method does turn out to be the only way around the y-sort problem (while hanging off a parent), I might need to check whether it might be better to have it switchable between the toplevel and global approach, because not everyone is using y-sort, and the global approach could end up being more expensive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants