Hey everyone! I am working on a taxi system but in order to make the character move to a seat, I will need to constantly check for seats within a certain area. I am having trouble with this as magnitude needs a specified part to work. I also tried making a touched event but that would not be ideal as the passenger will be moving around the map.
How would I go about doing this in an efficient manner? Thanks.
Could possibly use CollectionService to tag a new Seat each time a Taxi is added & then loop through the Table using magnitudes to see whether the NPC is close enough.
You can use the newer spatial query API, and you can make it more efficient due to overlap params so you can whitelist your passengers using OverlapParams instead of detecting uneeded parts: