Enemy follow player

Question

So im not very good in 3d but the only thing ive never done its hard : enemy that follow player.

Im trying an easy script and not very long but the tutorials i saw weren’t workin’ . I would like the enemy (that uses characterbody3d a collision shape and a meshinstance) to follow the player if you are a lil close (as like re2 or stuff like that)


Whats the script, and what’s not working?

1 Like

I deleted the script but the positions werent working because of null instance

Well, we can’t help you without seeing the script that causes you problems.

Did you try going through these tutorials already?

1 Like

As WCHC said we can’t help you with s script you don’t have. But in general a fairly easy way to accomplish this would be to add an area 3d to the enemy, connect it’s body entered event which gives the node, check if that node is the player, if so use it’s location to move the enemy. One you have that working use the exited body to stop/ return.

1 Like