Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can anyone recomende me guides on realistic npc behaviour?

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

3 comments

0

I have awnsered your question

0

So wait do you want your NPC's to have realistic AI or play animations?

0

@Bendebop he wants them to move and function like normal players do. Read his description. Anyways, I have given an awnser to his question

1 answer

✓ Accepted 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

0

It's all good until you try to use any of this in a real game that has things like doors.

0

door

This discussion is preserved as it was. New answers, comments, and votes are closed.