SpyrexDE/SmoothScroll

Weird behaviour with change_scene()

Closed this issue · 4 comments

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.

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 👍

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!

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.

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.