- Home /
How to place collectables along a path
I'm looking for a way to generate collectable items along a path in my levels. I want the items to be evenly spaced and go around in circles and around smooth curves (a la rings in Sonic the Hedgehog). I could place them all by hand but I wonder that there must be a better way. Can anyone suggest a method for setting a path that I could then generate the collectables along it?
Answer by robertbu · Dec 20, 2013 at 04:23 PM
Runtime or edit time? Spline code has been posted to this site a couple of times if you want a do-it-yourself solution. Or you can use iTween with its iTween.PutOnPath() function. iTween is free from the Asset store, and there is also a free path editor that would allow you to quickly lay out the path. And there are commercial spline packages for Unity. SuperSplines has been mentioned positively on this list, though I've never used it.
Edit time. I think I've seen the iTween one in passing but I'd forgotten about it. Sounds like what I need, thanks. If you post as an answer I can choose it.
Had to create an editor script and hack the iTweenPath scripts a bit to get it working in the editor (rather than runtime) but I got it working in the end :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613124547im_/https://answers.unity.com/themes/thub/images/avi.jpg)