Getting a target to fight back

How can i get a enemy target to follow the player around? I am trying to make a 3d game. I already have an idea as to how the target will attack, but he needs to be able to follow the player around to do so. How can I do this?

Take a look at this project

that appears to be a 2d game. will this work for 3d?

If it was made with Playcanvas (which it is) then it should work.

I tried using the code but it gave me so many errors. The game will not even run. Any other ideas?

Use the look at function then make it shoot? A bit primitive but it works.

I have only had a few weeks of experience coding, can you please explain?
Also, this conversation (comments) might help you as well.

ok, this gave me the abbility to get the target to look at the player. But I couldn’t find where the target actually moves towards the player. It also must be to where the player has to be within a certain distance from the target for it to follow them. Thanks

You must also use the forward function to get it to move.
this.movement.copy(this.entity.forward).scale(-1 * this.speed * dt);
In update function.

I had something in mind like the moveTo function, but don’t know how to use it