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

How would I check the number of parts around any one part with a script inside of said part?

Asked by
BRAEGON -8
5 years ago

So I have this really complicated fire script that I have spent a few hours on. The way works is the FireScript will randomly duplicate itself into a part it touches and set it on fire by giving it the fire particle effect that I have set. The only problem is that when more than fifty parts are on fire things start to get laggy because of the particle effects. I have the idea that I can set each fire script to calculate how many parts are around the part on fire and make the particles fewer and larger to decrease lag. If I had 1 part on fire it might have 7 particle effects but if 4 parts are together then they might have 3 each. The only way I can do this with each script is to place an invisible sphere that acts as a hitbox outside the part on fire and see how many parts it registers as touched. This is very laggy and I'm trying to make all of this a very clean design. is there any way to detect apart and add it to an array if it is within a certain range? Doing this I could use the number of parts in the array to change the effect

0
print(#part:GetTouchingParts)? DeceptiveCaster 3761 — 5y
0
I'll try that, that would use the whole idea if having a bigger part on the outside to act as a forcefield and might be to laggy BRAEGON -8 — 5y
0
If you had a large area you could also consider “FindPartsInRegion3“ ABK2017 406 — 5y
0
I want it to be in a diffinable area if possible BRAEGON -8 — 5y

Answer this question