0 votes

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:
https://we.tl/t-br0Bra0swe

Greeting,
Jabba

asked Jul 14, 2019 in Projects by jabba (29 points)

1 Answer

+2 votes

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.

answered Jul 14, 2019 by Dlean Jeans (3,915 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.