i want to make npcs that attack and dont just walk into you this would have to be done by animations but how to make then play those i am currently learning blender for good looking npcs can anyone recomend me guides for if im done so i can make npcs walk attack and just look normal
Can anyone recomende me guides on realistic npc behaviour?
1 answer
Hello there, RBLXNogin here! I am going to give you a short, simple awnser to your problem. There are several methods for realistic npc behavior and/or finding and striking the player.
Link: Make Smarter NPCS Using PathFinding Script Functions
If you would like to learn to develop this then there are functions in ROBLOX known as pathfinding and raycasting.
Accomplishing your goal will mean you will have to take a look at the A* algorithm, which is the workhouse/workplace of pathfinding. There are several techniques, including breadcrumb trails for pursuing AI characters. Additionally, you can even apply barebones (1,0,0) vector for moving right and (-1,0,0) vector for moving left, and so on at specific intervals while your game is running. My recommendation is getting something started first before bringing your hopes us. While reading on pathfinding, you will probally enounter graphs and other sorts of data, so you should intensively
"The new pathfinding functions allow you to not only make smarter NPCs, but have them remain smart in levels with complex geometry. To put it simply, ROBLOX is doing the heavy lifting for you."
Pathfinding is a function in roblox which allows you to generate new paths for AIs, with an addition to mimicing current paths of the players. This is how games make a NPC follow a player, and even how they develop beams to charge at you. Pathfinding is a really interesting subject that you should read up on. Here are some links:
Make Smarter NPCS Using PathFinding Script Functions
and
How-to: Get Started with AI Pathfinding
and a more advanced tutorial.
Roblox - Zombie AI Tutorial w/ Pathfinding (Raycasting, Magnitude, Pathfinding)
Overall, I recommend starting with the first link and moving down. Additionally, after you catch up on path finding, you should explore other concepts such as Raycasting, Magnitude, and etc and explore this new area of roblox scripting.
If this post has helped you then I recommend clicking the checkmark to let the world know this is your awnser. Anyways, enjoy!
2 comments
It's all good until you try to use any of this in a real game that has things like doors.
door
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
I have awnsered your question
So wait do you want your NPC's to have realistic AI or play animations?
@Bendebop he wants them to move and function like normal players do. Read his description. Anyways, I have given an awnser to his question