Dodge the creeps: "script inherits from native type 'area2d' so it cannot be instanced in object of type node"

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

Dear All,

First of all I am still new to programming and godot, so I hope someone is able to help me.
I am bussy with the dodge the creeps tutorial, it all worked fine (after a lot of trial and error). I have added a few functions to the game:
-Created a bullet
-Let the creeps “die”

these to functions worked oke (ofcourse with trial and error).
But i wanted to add a kill counter, after I tried some stuff (I dont remember exactly what i did…) I got the following error: “script inherits from native type ‘area2d’ so it cannot be instanced in object of type node”
I think it has something to do with me instancing de playerbullet2 in random nodes… but i can not rember where it went wrong exactly.

It has been weeks now and i cannot get it back to play normally.
In the following link it is able to download my version of dodge the creeps:

Greeting,
Jabba

:bust_in_silhouette: Reply From: Dlean Jeans

I didn’t see your project but from the look of it seems like your script is extending Area2D which is not the type of your kill counter or in general, whatever node you’re attaching the script to.

So change extends Area2D to extends Node (Node should work for most if not all cases) or the type of your kill counter node or any kind of nodes attached to the script.

1 Like

You saved me <3