hello, i’ve been working on my first project in godot without beeing guided through a tutorial, rn i’m stuck at a point because i’m trying to make a system so the player can get his wand out and in by pressing one key.
i managed to make the wand go out but i can’t figure out how to put it back in.
what i wanted to do is send a signal to the wand scene that only gets emited if the key is pressed and my var “wand_out” is true, the issue is that my wand scene isn’t in the main scene (level).
should i just instantiate the wand scene as a child of player in the level scene or can i do what i want through some other ways ?
a little pic
well except if that’s not what you meant i did in fact connect the signal to a function or atleast i think i did.
in that specific part of the code (i removed everything i put to test if something would change), the code sends a signal called get_wand_in that is connected to the function _on_get_wand_in in the wand scene that should execute when the conditions are met, maybe i don’t get it but i think that’s what you meant
well there’s no error it’s just that the wand doesn’t disappear when i press the assigned key, i’ve tried to put something to print to see if the signal is received but it isn’t…
i think it’s because i didn’t use the UI godot gives you when connecting the signal but that’s because godot doesn’t let you connect stuff that isn’t on the same scene
i guess i could just put the wand as a child of the player scene but my main fear are optimization issues…
speaking of optimization, having the wand as a child of the player would mean it’s displayed by default and if i hid it i suppose it’ll still take some place in memory so i’d have to queue.free it until i need it
if this sort of stuff doesn’t impact game performance i guess i could just put it and that’ll simplify everything, also my game is a roguelike where you go room to room so i don’t even know if i should be worried about this kind of stuff but please do tell me