Hey there, does anyone know how Bee Swarm Simulators does their tool system? What I mean by this is, that when you're collecting pollen, they have a system to detect every flower around you within a specific radius, if you've played the game you may know about this
I don't believe they just use .Touched, some math to generate patterns for collections
Lets say I wanted to have a collection system that will collect anything around the player (the yellow square) (Image below)
What would be the best way to accomplish that?
Granted, that I will be making the green parts smaller upon activation, like bee swarm sim. I'm unsure if Bee Swarm Simulator uses .Touched (doubt) but if anyone knows the best way to handle this, I'd appreciate it
Originally I was going to create patterns that I would weld to the character, and from there I would use .Touched, or fire raycasts from the part to the ground, however I believe this would be computationally expensive https://gyazo.com/18605d00d972bbe454c914b8d7009455
I believe they use Region3 and get every single flower that is in the Region3 and collect it. That will be the best way to accomplish
It's likely that they use OverlapParams then query the flowers that are within range of your avatar/tool position; I'm not too sure as I've never played this game before. If you aren't aware, OverlapParams is a relatively new 'spatial query' API that supersedes the deprecated Region3 which is very taxing on performance compared to OverlapParams.
Announcement - https://devforum.roblox.com/t/introducing-overlapparams-new-spatial-query-api/1435720
API - https://developer.roblox.com/en-us/api-reference/datatype/OverlapParams