glass-brick / Scene-Manager

Godot plugin for managing scenes and transitions
MIT License
330 stars 17 forks source link

Im not sure if this is a bug or not. #27

Open Galllaa opened 1 year ago

Galllaa commented 1 year ago

Describe the bug Hi, to make it short when i change the scene and go to the next and die it never reloads the current scene. I have a state machine and when im in Die-State after the animation is played it should reload the current scene and when the scene starts from the beginning i go to Spawn-State but it never happens.

To Reproduce State Machine GD-Quest

Expected behavior True - get_tree().reload_current_scene()

Screenshots Video Bellow

Desktop (please complete the following information):

Additional context I tried in the Die-State ( SceneManager.reload_scene() ) but same results. If i go (get_tree().change_scene_to_file()) so no SceneManager to change the scene it works as intended.

https://github.com/glass-brick/Scene-Manager/assets/105984870/67da1f1e-beee-4fe3-a676-907eb3e3d9a1

jabsatz commented 1 year ago

Hello @Galllaa , do I understand correctly that, if you replace SceneManager.reload_scene() for get_tree().reload_current_scene(), everything works as intended? If so, that does sound like it might be an issue on our side, unfortunately I don't have enough information to reproduce this as-is. Do you have a link to the project you're using, that I could clone and test directly? Or could you create a minimal project where this is reproducible?

Galllaa commented 1 year ago

Link to replicate the issue : https://www.mediafire.com/folder/k3ajypk45iyu5/SceneChangeTest if you want i can upload it to another site just let me know, is there a discord maybe it would be easier to communicate then over here.

jabsatz commented 1 year ago

We don't have a discord unfortunately, I will try to check this out this week though

jabsatz commented 1 year ago

Actually checking the link, it looks like I need MediaFire Premium to download files in bulk, could you upload a zipped folder or use a different service? image

Galllaa commented 1 year ago

Yea shoud zip it before my bad. Here is the zipped project https://www.mediafire.com/file/z6pca5pz4j6rdtg/SceneChangeTest.rar/file Tnx for taking time.

Galllaa commented 1 year ago

Any news for this?

myin142 commented 11 months ago

I had something similar happen recently. Do you get any errors when calling the reload_scene function that the scene file could not be found? I solved it by using a PackedScene.

jertlemiah commented 5 months ago

I don't know if this plugin is still being worked on, but I'm encountering this exact same issue

jertlemiah commented 5 months ago

It seems to be a problem with how the Change scene works. If I use the reload scene without changing scenes first, it works as expected. But changing the scene, then trying to reload the current scene causes the "Resource file not found: res:// (expected type: )" error <C++ Error> Condition "!file_check->file_exists(p_path)" is true. Returning: Ref() <C++ Source> core/io/resource_loader.cpp:279 @ _load()

jertlemiah commented 5 months ago

The way I got around this was to simply use change_scene on the current scene's path

Welshy92 commented 3 months ago

I believe this issue is still happening. It only seems to occur on scenes that have been loaded with the scene managers change scene function. This is what I found:

My personal workaround is instead of using SceneManager.change_scene() , I used the SceneManager.fade_out() function, then get_tree().change_scene_to_file() and then called SceneManager.fade_in() on the new scene. This then meant the SceneManager.reload_scene() was working correctly. It's a couple of extra steps but it works exactly how I expected the normal method to.