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

How does Bee Swarm Simulator's Tool System work?

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

2 answers

✓ Accepted answer

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

12 comments

0

makes sense

0

Thank you, I'll read up on region3's as I'm pretty unfamiliar with it, but just to clarify I would need to create the pattern region, then detect every flower that is in in region on tool activation??

0

well yes

0

You would need FindPartsInRegion3

0

But first you need to have a Region3 made for the parameter tho.

0

To create a region3 do region3.new(min, max). Min is the 1st corner and max is the 2nd corner, to demonstrate, creating a region with the code Region3.new(Vector3.new(0,0,0), Vector3.new(1,1,1)) will look like https://imgur.com/5a1CJQe

0

I really do appreciate the help, I'd mark this post as the solution but I'm unsure how haha

0

I believe you can use multiple regions for that? I'm not an expert for that one since I don't use it much

0

to accept this answer the button is below this comment vvv

0

i'll acept nob

0

WAH

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

1 comment

0

Never heard of it, I'll have a look though thanks! Although the game has been out before this I believe so they may use region3, but I'll switch to this!

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