Error with Dodge the Creeps. Invalid call . Nonexistent function 'instance' in base 'Nil'.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Entropyss

Hi. So I got started with the Godot tutorial dodge the creeps. The player scene works as a standalone. I’ve now added Main, HUD, and Mob scenes and for some reason it crashes after I press start button. The player sprite appears then freeze: debugger reads: Invalid call. Nonexistent function ‘instance’ in base ‘Nil’. The line in Main script reading var mob = Mob.instance() is highlighted. Yes the I in instance is in lowercase. any ideas?

Mob is not set (that what debbugger is saying) show your code otherwise it will be hard to find solution

Bartosz | 2018-03-23 18:37

:bust_in_silhouette: Reply From: kidscancode

It appears you didn’t assign a value to Mob. To do this, click on the Main scene and you’ll see a “Mob” property in the Inspector. Drag the Mob.tscn file from the FileSystem dock and drop it into that property.

Nice one, and suprisingly thats the only mistake I made

Entropyss | 2018-03-23 21:32

Me too, I also made same mistake :slight_smile:

burak | 2018-11-15 11:13

can confirm this mistakes is still being made in 2020 :slight_smile:
many thanks to all of you

dd801 | 2020-03-05 03:38

Same in 2021. I could swear I’d already added Mob.tscn to the property in Main, specifically because I had so much (dumbass) trouble figuring out which node had the property in the first place, but I just checked because of this post and lo and behold… no assignment.

bellxion | 2021-08-14 19:08