@alex0264: A couple things could be causing the issue.
The first, is that you are instancing a scene called mob
(presumably stored in a class variable) into a local variable called mob
. This can confuse GDScript and is generally considered bad practice, because it can cause strange errors that are hard to debug. I would either change var mob = mob.instance()
to var clone = mob.instance
or rename the class variable so its something like var mob = mob_scene.instance()
. That way, you avoid having issues because the variables have the same name.
The second issue, and the one the debugger is showing, is that the mob
variable is a PathFollow2D, not a PackedScene, so it cannot be instanced. How are you defining mob
?
You will need to have it defined with something like var mob = load("res://path_to_mob_scene_here.tscn)
or var mob = preload("res://path_to_mob_scene_here.tscn)
for it to be a packed scene that you can instance. Without loading/preloading the scene, you will not have a PackedScene in the variable, and therefore you will be unable to instance it. I would suggest double checking how the mob
variable is defined (and maybe rename it to something like mob_scene
) to make sure its using load
or preload
.