Path moving by 2 meters up

Hi everyone,
So I followed the course step by step (except the bezier) and I was wondering how it can be that my Path moves by 2 meters after get_tree().reload_current_scene() is called.
I added a gif that shows what happens.
Untitled design

Things that might help:
I use Godot v4.2.1.stable
The Path3D was done following this (can this be the reason because it happens even by redoing the Path3d):

Thank you,
I appreciate you time reading this.

Hello. That’s an interesting behavior… Do you have any code inside the path3D _ready function?? Also, please share your node tree… it seems like some parenting issue but it’s hard to tell without a view of your tree

1 Like

aye, seems a little strange how its not happening on first load but only when reloading when that should just be the same.

be good to see a little of the code and scene setup, just to get a look to see.

if that doesnt yield anything, then ill pop a link up so we can have a look at your project.
you could zip the entire project folder via windows, zip it up and upload via
http://gdev.tv/projectupload
and pop my name in there, as ill get an email notification.

just to get a look as it does sound strange its only happening on reload.
cheers

I just experienced something similar (which I finally managed to solve 2hrs later).

This may not have anything to do with your specific issue, but check carefully to see if there are any extra instances of this path anywhere - buried as children, inherited from other scenes, etc. For some reason, Godot sometimes has different priorities when loading a scene for the first time vs. reloading a scene. In my case, it had to do with cameras, of which there can only be one active at a time. On load, Camera A would take priority, and on reload, it was always Camera B (which I had forgotten existed, because it was buried deep in the scene tree).

If it’s not extra instances and you can’t find a solution, you may have to change the way you reload scenes. I had problems with get_tree().reload_current_scene() in another project; uncollected garbage from the previous instance of the scene was being carried over after reload, so I built a scene manager to handle things. When it reloads a scene, it checks what scene it is, then kills the current scene and instantiates the same scene again. I hope you find the real solution, but if not, implementing this should at least let you continue the course.

2 Likes

Thank you :pray: everyone for tanking the time and looking into.

I recreated the path one more time and this time I did just follow my instinct and what I learned the in the time I was playing around with all the values.
Now everything works fine and the difference between the buggy one and the new path is that the values of the curve where not the same. in the screenshot are the values I now have for the points. The red underlined one was on 4 and the green underlined ones was -4 and the Transform > Position z was on -2

It now works but even if I don’t understand why it jumped because if I put my Position z to -2 it should have stayed -2.

I guess that is what will be my future, fixing bugs that make no sense :rofl:

2 Likes

glad you got it sorted. must have been proper frustrating tho

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms