You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I've got two functions that create instances of one same packed scene, the packed scene is a preloaded global variable and the first function successfully has access to it: (It's the addend_scn member variable)
But then, the next function that accesses the packed scene has a reference to null, you can even see that the variable to which the instance points to is also null:
Oddly enough, the position assignment and the adding of the scene as a child of the node is being successfully executed. It could be important to note, that if you remove the create_grid() call from the ready() function, the add_results() has complete and correct access to the member packed scene variable.
Steps to reproduce
Add a breakpoint to line 30 of AddendGrid.gd and play the AddendDrawer scene, you'll see that my_unit is pointing to null.
This is a debugger issue, the debugger incorrectly shows the variable as <null> at times, you can confirm this by doing print(my_unit) and see it is not <null>.
Probably the same issue, but that has not been fully confirmed: #74297
Let's wait for the pull request to be approved then.
Although it's weird that the first function can reference the packedscene in the debugger. It's the same packedscene and the instances should be of a similar size too.
A fix should check why when it is being called a second time it returns a bigger value (Keeping in mind that when only calling the function that gets the bug in the debugger, without calling the other one first, the debugger does show the value)
Godot version
4.0stable
System information
Windows 11
Issue description
Hi! I've got two functions that create instances of one same packed scene, the packed scene is a preloaded global variable and the first function successfully has access to it: (It's the addend_scn member variable)
![Godot Bug 2](https://user-images.githubusercontent.com/100316997/223120959-7fee6a5f-55af-41d1-bf90-27c509cb4aae.png)
But then, the next function that accesses the packed scene has a reference to null, you can even see that the variable to which the instance points to is also null:
![Godot Bug 1](https://user-images.githubusercontent.com/100316997/223121238-84daf63c-4dd5-4362-805c-2db1d28ee998.png)
Oddly enough, the position assignment and the adding of the scene as a child of the node is being successfully executed. It could be important to note, that if you remove the create_grid() call from the ready() function, the add_results() has complete and correct access to the member packed scene variable.
Steps to reproduce
Minimal reproduction project
Sample Project.zip
The text was updated successfully, but these errors were encountered: