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
COMMUNITY QUESTION
How would I check the number of parts around any one part with a script inside of said part?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
print(#part:GetTouchingParts)?
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
If you had a large area you could also consider “FindPartsInRegion3“
I want it to be in a diffinable area if possible