1)I create a Hboxcontainer in my main scene,2) I go to my script of cards, which is istanciated at start the game a lot times, but not is at main scene root if i dont start game, then i get the referencing pressing at the create Hboxcontainer and dragging to my script to create @onready,3) i try print the Hboxcontainer object doing print in that script and i get<Object#null> always, i can call the from any place except from there.
I create more Hboxcontainer, buttons, textures, node2d, control to test, same result always. Right now i can,t create nothing can reference in that script, worst what is? My game is actually working, the old nodes working perfectly and the cycle of a deckbuilder have created. Old nodes are Hboxcontainer, buttons, control.
I try using referencing unique names with option % and nothing.
Whenever people ask for help with a particular piece of code, I often ask myself why they donât include that code as part of the initial post. Please, please, please show your code if you want help. Otherwise, I can refer you to a website where ranting is the default: www.reddit.com
Seriously though, I find it hard to parse your description of the problem. Looking at the code in question would be much more productive â especially since your actual question refers to a specific cursed script.
the node is a texturebutton, all the cards in my game are texturebuttons with only the texturebutton how root the scene and nothing more, all the cards are only images really, and i want pressed() function and can sort them easily in boxcontainer
No. like i was saying, the script(problematic script) is attached to only card scene, which is only a texturebutton, he is not initially in the main scene where Control is.
A scene unique node can only be retrieved by a node inside the same scene.
Since your card scene is a different scene than the one containing the unique node %PlayedCards, you canât (directly) use that reference in its script.
I was very confused; I had the feeling I was always doing the same thing, but I've been calling the objects in the script in various ways. I need to analyze it carefully. Thank you so much; I was going crazy thinking it was the Godot program being inconsistent.