06-06-2014, 06:33 PM
Hi,
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:
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
}