I have a Scene (called "Cave") which serves as a level transitioner. It works as intended, but when I have this Scene opened in the Scene Tab, or another Scene that has it as a child, the Output starts spamming
" res://Source/Solids/Cave.gd:11 - Invalid get index 'hitbox' (on base: 'KinematicBody2D (Player.gd)')."
The Game runs perfectly fine, but when i am working and the Output starts spamming this message, the pc starts lagging a bit (it is not high end haha), and it also annoys me.
Here is the relevant part of the script for the Cave:
onready var hitbox := $Hitbox
onready var anim_player := $AnimationPlayer
onready var player := get_parent().get_node("Player")
export var next_scene : PackedScene
func _process(delta: float) -> void:
if player.hitbox.intersects(self.hitbox, Vector2(0,1)):
In the Player Script I also have an onready variable called "hitbox", and what I understand form the Output message, is that there is some sort of problem with that variable. As I said, the game runs fine, and when the player runs into the cave, the level transition also runs fine, so the game actually "finds" or "use" the variable "hitbox" correctly.