- Edited
Hello there, first message for me. Happy to be part of this!
I'm having a hard time trying to deal with classes and instances in godot, maybe because i'm too used to object oriented languages (not an expert though, i'm an easy intermediate)
I hope I'm not too dumb in this and didn't miss any very basic notion, but i really tried to figure it out for hours and read a lot of documentation (but maybe read the wrong ones)
The situation : I'm trying to play a character getting inside and outside a house (so through different scenes).
The point is i want to keep the scenes processing while the character is not in, so i'm playing with hide and shows not to reload the scene from scratch everytime the character gets in.
i would like though to queue_free the character from the scene when it gets out so that he doesn't interact with the invisible scene while i'm doing stuffs in the other.
the system i've tried then is to create a "game_panel" script class, from which inherit both outside and inside scene, and that has "_character" as a parameter, which is intended to contain the scene's character's node which I'd like to manipulate (queue_free or set back to spawn point, for instance)
the point is I suppose godot is not working this way since when I try to put for instance in game panel "when getting out of the house, queue_free character", i get a null exception, as in the game_panel class I didn't assign any value to character, since i figured it out as an "abstract" variable to be defined in each scene of the game.
Is there a detail i'm missing, or is my approach completely mistaken to solve my problem ?
Thanks for reading !!