Hi, i'm using godot for maybe 3 months. I have a Scene called Pistol, and it haves an Are2D node responsible for detects if the player enters his area, and after that, store the value in a Global variable called take_weapon.
In another Scene, called Mundo (World in portuguese) i'm going to use that value to delete the instance that i've created for the Pistol Scene, thing is, for some reason i can't delete the instance.
Sorry if it was hard to understand, english is not my main language. Here's the code of my game to help you guys. Thanks in advance.
var pistolPath = preload("res://Pistol.tscn")
var count = 0
var p = pistolPath.instance()
while count == 0:
count += 1
if Global.take_weapon == false:
elif Global.take_weapon == true:
elif Global.take_weapon == null:
if Global.take_weenter code hereapon == true:
var onfloor = true
Global.take_weapon = can_take
can_take = true
can_take = false