Hmmm... I'd expect that error to be:
Invalid call. Nonexistant function 'instance' in base 'Nil'
(note Nil
instead of bool
).
That's because you've defined two versions of bullet
. The first one contains the preloaded scene and is global
- defined here:
var bullet = preload("res://Bullet.tscn")
The second one is a variable that's local to the HeldItemLoop()
method - defined here:
var bullet = bullet.instance()
So, in that case, the bullet.instance()
reference would be looking at the local
variable, which hasn't been defined to anything yet - hence I'd expect the error to contain Nil
instead of bool
.
Either that, or there's more code interaction than shown above...