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

What would be the best way to spawn items around a node, without the items touching?

Asked by 5 years ago

There are a few ways, I could loop and move the items after checking if an object is there. I could also create a virtual radius around the node and move the object's into random vectors inside the radius or I could make a model of how I want the objects to be, and place the model inside the radius or next the the node. However, are there any there more efficient ways?

0
Not sure if this is what you meant when you mentioned a radius around the node - and it also might not be terribly efficient comparatively to other methods, but you could use cosine and sine multiplied by a scalar to spawn them on random radii starting at 0 and reaching 2pi. SummerEquinox 643 — 5y
0
True, but would a Region3 be better? Stephenthefox 94 — 5y
0
I don't know too much about performance on Roblox so I wouldn't be able to tell you. What kind of behavior do you want the spawning to act in? In a circle? Random spots in some x by z area around the node? The latter may be better handled with Region3. SummerEquinox 643 — 5y
0
I mean, it doesn't really matter how the object are put around the node as long as they are close by and not touching. Stephenthefox 94 — 5y

Answer this question