06-06-2014, 07:49 PM
(06-06-2014, 06:33 PM)'Jake' Wrote: Hi,I think it was a bit late at night when I posted that... was also editing the code to remove excess stuff that wasn't related to this question.
maybe you didn't post the whole code involved, but what I see makes no sense. tfAtlastPoint seems to be unused and distBetweenPoints doesn't do what you expect because you're calculating the distance between a world position and a relative value (0..1).
The question is how do you want your collectibles to be placed? Equal F distance? Equal world unit distance?
Here's a pseudocode:
Code:for (int i=0;i<31;i++)
{
var myNewGameObject=new GameObject(...);
myNewGameObject.position=SplineGroup.Interpolate(i/30); // <= this will be equal F
myNewgameObject.position=SplineGroup.Interpolate(SplineGroup.DistanceToTF((SplineGroup.Length/30)*i)); <= this will be equal distance
}
The final result I'm looking for is that the first collectable is placed a short distance from the start of the spline, then the next is placed between X and Y random distance after the first, then the next is placed another X and Y random distance from the first, and so on. That's the question (or comment) I should have asked last night.