Before you tell me that the game is supposed to stop running during debugging, I know that already. This is different.
I have a script that handles the slots of an inventory. Most of the script works, except for a part of it. I started to debug it to figure out where it stops working, but I can't exactly determine the problem because the engine decides to stop running the debug session.
Here's the problematic part, breakpoints marked, problematic breakpoint also marked:
if event.button_index == BUTTON_RIGHT and event.pressed:
var interactableScript = preload("res://scripts/interactable.gd")
var item = Area2D.new()
var itemSprite = Sprite.new()
var itemClickBounds = CollisionShape2D.new()
var boundsShape = RectangleShape2D.new()
boundsShape.extents = Vector2(17, 17)
itemClickBounds.shape = boundsShape
itemSprite.texture = txture
item.add_child(itemSprite)
item.add_child(itemClickBounds)
item.set_script(interactableScript)
item.itemName = item #breakpoint here
item.itemTexture = txture #PROBLEMATIC breakpoint
item.usage = usage #breakpoint here
GVars.currentSceneRoot.add_child(item) #breakpoint here
clear()
To be clear of what it's supposed to do, it's supposed to drop an item out of the inventory and onto the world (for now, at the origin point).
What keeps happening is whenever the debugger gets to the problematic breakpoint, the inspector blanks, meaning every tab except for the resource and the reference tabs disappear. Then it just... stops.
I've tried this multiple times, same issues, don't know why it's doing it. I've even removed the problematic breakpoint, only to find that the problematic breakpoint "moves" to the breakpoint next in line. The stopping issue only happens when I have breakpoints. If I'm skipping breakpoints, it doesn't happen and keeps running through the execution of the script.
Any ideas why this is happening?