Need help with making an enemy!

I want to have some sort of enemy in my game which wanders around the level and once he sees the player in his line of sight, chase the player until he lost the player and once he is close enough restart the level.

I think I know how to do the last part, I’ll add a box collider or something like that onto the enemy gameobject and once the player touches the collider I can restart the level, that isn’t really the problem.

I just do not know how to make a gameobject walk around the level (maybe let it walk to some position like waypoints and make a list of them) and check if he can see the player. I got very little to zero knowledge about coding, I can read and understand most codes, but I am not very good at it, I just started coding etc. Anyone can push me into the right direction or maybe have some code already I could use.

If anyone wants to help I appreciate it a lot and if you need more information, I will try to tell more.

Also I have tried to use the Rain AI, if anyone knows how to use that for this, it would be a lot more easier I guess. Anyway thanks for reading and hopefully you can help me!

Look, you wrote a well written question, mannered and everything. We get these kinds of questions all the time. I need this script, i need that script, i can’t code. Truth is, if you dont have a friend who is willing to do it, or you stumble uppon a guy who is in REALLY good mood, you’ll have to do it yourself.


Luckily for you, unity has REALLY REALLY good tutorial series that is just for you!

>>>You can check it out here.>>>

You will also be able to use code snippets i think. Plus, in 4.2 you have navmesh in free version so basic pathfinding is easy to implement.

Good luck to you sir.
Start small!