How could I create a monster NPC

So how could I create a monster, that would wander around the labyrinth and when it sees a player it would chase after the player?

4 Likes

Pathfinding and moving the NPC to the player if it’s close or within a line of sight. There’s models in the toolbox or hanging around on Roblox that can help you create this system, along with resources you can find here or on the Developer Hub.

If you explicitly need the monster to see the player to start chasing them, there’ll be a bit more effort involved in this, such as using CFrame math to determine a range of vision for the monster and chasing the player if their HumanoidRootPart falls within that range.

There’s a couple of threads on line of sight you can review over. I recommend saving that for last though: get your NPC done and allow it to follow players within a hard-set radial line of sight (magnitude of the distance vector between players and the monster), then modify this seeking logic to use a line-of-sight search method.

9 Likes

Check out this tutorial video, or other tutorials on the same channel. There are quite a few different “types” of AI. Once you’ve learned the basics of it, you can start creating AI for your specific game.

2 Likes