Hello, we are creating a 2d godot game in which we need enemies to appear randomly all over the map.
So far we have an enemy that chases you if you enter a 2d area, the player and the map.
Our problem is that when the enemy appears randomly, even though the player is within its area of vision, it does not chase the player and instead, it moves away.
Also, it gives the impression that the spawner moves with the player and does not stay still despite not being a child node.
We appreciate your help with this project
Of course , I attach here a document with the code of our enemy (zombie), the code of our spawner, the code of our player, an image of the player within the field of vision of our enemy and an image of the error that happens with the spawner (we have hidden the area of vision of the enemy so that it can be seen better).
Thanks for your help
Hi!
We still need to ask access for the file.
You can paste code (between ~~~ for it to be formated) here or screenshots directly. It will help!
2 thoughts though :
It might be a problem of collision layers and masks. You can start by having a look at that.
To debug, try to print something to console when something enters the area2D.
Cheers!
Since I’m a new user, it won’t let me send multiple photos, so I have to send you our compressed project. I’ve attached a link here to download it from MEGA.
I hope it helps you solve my problem
I appreciate your help.