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

How would i prevent parts from spawning too close to each other? [Closed]

Asked by 6 years ago
Edited 6 years ago

Please include the code which you are trying to use, so the community will be better-equipped to help you with your problem.

I have a script that spawns parts randomly on a baseplate but sometimes they spawn on top of each other or really close to each other. How would I prevent this from happening?

0
Does it include the y axis? waffle792 8 — 6y
0
no it does not Austinn_K 31 — 6y
0
You could check the magnitude between the position of the part you're going to place, and any existing parts. If it is smaller than what you wish it to be, then find a new position and compare again. climethestair 1663 — 6y
0
Wouldn't that cause alot of lag? Austinn_K 31 — 6y
View all comments (2 more)
0
No idea waffle792 8 — 6y
0
Mmm magnitude or shooting rays or region3s Vulkarin 581 — 6y

Answer this question