how to make enemy shoot and follow player in fps

I am making an fps and I am struggling on making the enemies, I tried multiple things, but they don’t work. I like the idea of some enemies running up and biting you, and some shooting at you, I already have a player health and everything else. Thanks in advance. :slight_smile: :slight_smile: :slight_smile:

There are 2 types of shooting you can implement: Raycasting or displaying the actual bullet. If the former is the case, watch this video: Shooting with Raycasts - Unity Tutorial - YouTube But if the latter is the case, this might help: Unity FPS Course - Shooting Bullets - YouTube


@Sansgamer120 I deleted a part of answer because it is not the best one. If the enemy simply faces the player and moves, it will run into walls and stuff which is pretty dumb. Use Unity’s Navmesh for this. Here is a Brackeys video: Unity NavMesh Tutorial - Basics - YouTube I will come back and edit this only if I find a better solution or something.