- Home /
notify just gameobjects close to specific position
I have to simulate a crowd of humans and cars who are AI agents: they have goals, so they are moving in my city to accomplish goals. My agents are hooked up to events (similar to C# events): I randomly generate an event, such as "alarm fire", but I don't want to notify all agents in the city, but just those agents who are close to the position where fire has started (I need to optimise my code, since I have 500+ agents in the scene).
Is it possible?
Answer by tanoshimi · Feb 22, 2015 at 04:58 PM
This question is not really suitable for Unity Answers, because there is no one specific technical solution we can give you. There are many space-partitioning methods that help you to sort and search through your agents in a more efficient way based on their position - you might find this article helpful as a start: http://gameprogrammingpatterns.com/spatial-partition.html
Your answer