SpyrexDE / SmoothScroll

Addon for the Godot Game Engine that adds a SmoothScrollContainer.
https://spyrexde.github.io/SmoothScroll/
MIT License
132 stars 11 forks source link

Weird behaviour with change_scene() #9

Closed FoggyFella closed 1 year ago

FoggyFella commented 1 year ago

So I've got a main menu, it has a few buttons which just change the scene. One of those scenes contains the SmoothScroll Container and for some reason when I change the current scene to that one the container doesn't smoothly scroll. I've sort of found out that the issue may be in these lines of code in the _process() function:

if content_node.rect_size.y - self.rect_size.y < 1:
    return

When I remove these lines and change to the scene, it scrolls smoothly but for some reason the scroll bar appears on the left instead of the right and behaves very weirdly.

This is my first time writing an issue, so if there is some information missing let me know and I'll try to provide.

SpyrexDE commented 1 year ago

Thanks for submitting this issue! To me, it sounds like there is something wrong with your scene setup. Could you try reproducing this issue within a minimal project and upload it here? This would be very helpful for understanding what is going wrong and how to fix it 👍

FoggyFella commented 1 year ago

Smooth Scroll Issue.zip Here. If you run just the creditcontainer scene it scrolls smoothly, if you run scene1 and change it to scene2 with the button, no smooth scrolling. Hopefully this will be useful!

FoggyFella commented 1 year ago

Huh, looks like I fixed it! I just added a new SmoothScrollContainer as a child and then set it as the root of the creditcontainer scene, I deleted the old one. Update: I added a custom theme to the new one, and the issue came back, looks like it's something to do with that.

SpyrexDE commented 1 year ago

I will close this issue due to heavy development on the godot-4 branch. If this issue persists in the Godot 4 version, please open a new one, providing an updated minimal reproduction project using Godot 4.