Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How does Bee Swarm Simulator's Tool System work?

Asked by 2 years ago
Edited 2 years ago

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

Log in to vote
0
Answered by
Xapelize 2658 Moderation Voter Community Moderator
2 years ago

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

0
makes sense NEILASc 84 — 2y
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?? to_number 5 — 2y
0
well yes Xapelize 2658 — 2y
0
You would need FindPartsInRegion3 Xapelize 2658 — 2y
View all comments (8 more)
0
But first you need to have a Region3 made for the parameter tho. Xapelize 2658 — 2y
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 Xapelize 2658 — 2y
0
I really do appreciate the help, I'd mark this post as the solution but I'm unsure how haha to_number 5 — 2y
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 Xapelize 2658 — 2y
0
to accept this answer the button is below this comment vvv Xapelize 2658 — 2y
0
i'll acept nob imKirda 4491 — 2y
0
WAH Xapelize 2658 — 2y
Ad
Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

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

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! to_number 5 — 2y

Answer this question