Hello,
I am currently building up a city in Unity3D and wonder how I would efficiently build up some sort of movement for NPCs walking around the city.
I have tried a lot on my own with own pathfinding scripts which turned out to be neither efficient nor really good.
So this is what I came up on my own without NavMesh:
[gypwc
The problem is of course that the pathfinding is crappy and that the character does “calculate” dynamically the next path so it stands still for some milliseconds upon reaching the destination.
The idea I had to fix this was using NavMesh which uses points.
I am not really sure whether this is good for this case or rather bad.
My idea was to create a dynamic environment, meaning the script applies for every type of city without using points.
Currently I get all the sphere overlaps and choose a path randomly, I tried to never access the previous destination to prevent this sort of back and forth, but it does not really work out well.
My setup is that I would tag every walkable prefab and the character searches for these around him to pick the next destination.
This is, in my opinion, quite dynamic. NavMesh though has a rather not dynamic system where I would have to define points for characters to travel, so what is your idea on that?
1. Improve my own script
2. Set up paths individually ( How would I go for a 100 npcs where I would like to achieve some sort of random flow like in a city? )
3. Does navMesh maybe have some sort of thing I try to achieve?
Furthermore I would like the characters to be dynamically capable of interacting with other objects, such as benches to sit on (by chance) or I don’t know, sit on a bus stop and get on a queue to step into the bus and get out somewhere else.